Skip to content

Commit

Permalink
(conan-io#7793) boost: only export required patches + modernize
Browse files Browse the repository at this point in the history
* export required patches only

* modernize
  • Loading branch information
SpaceIm authored and ivanvurbanov committed Dec 2, 2021
1 parent 29db743 commit 1b889cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,12 @@ class BoostConan(ConanFile):

short_paths = True
no_copy_source = True
exports_sources = ['patches/*']
_cached_dependencies = None

def export_sources(self):
for patch in self.conan_data.get("patches", {}).get(self.version, []):
self.copy(patch["patch_file"])

def export(self):
self.copy(self._dependency_filename, src="dependencies", dst="dependencies")

Expand Down Expand Up @@ -766,7 +769,7 @@ def _run_bcp(self):
self.run(command)

def build(self):
if tools.cross_building(self.settings, skip_x64_x86=True):
if tools.cross_building(self, skip_x64_x86=True):
# When cross building, do not attempt to run the test-executable (assume they work)
tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "libs", "stacktrace", "build", "Jamfile.v2"),
"$(>) > $(<)",
Expand Down Expand Up @@ -1085,7 +1088,7 @@ def add_defines(library):
@property
def _build_cross_flags(self):
flags = []
if not tools.cross_building(self.settings):
if not tools.cross_building(self):
return flags
arch = self.settings.get_safe('arch')
self.output.info("Cross building, detecting compiler...")
Expand Down
2 changes: 1 addition & 1 deletion recipes/boost/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def build(self):
cmake.build()

def test(self):
if tools.cross_building(self.settings):
if tools.cross_building(self):
return
self.run(os.path.join("bin", "lambda_exe"), run_environment=True)
if self.options["boost"].header_only:
Expand Down

0 comments on commit 1b889cc

Please sign in to comment.