diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index d845fca4e54da..03b0a239404c6 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -21,7 +21,7 @@ import sys import yaml -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.57.0" # When adding (or removing) an option, also add this option to the list in @@ -876,8 +876,7 @@ def build(self): full_command = f"{self._b2_exe} {b2_flags}" # -d2 is to print more debug info and avoid travis timing out without output sources = os.path.join(self.source_folder, self._bcp_dir) if self._use_bcp else self.source_folder - full_command += f' --debug-configuration --build-dir="{self.build_folder}"' - self.output.warning(full_command) + full_command += f' --debug-configuration --build-dir="{self.build_folder}" stage' # If sending a user-specified toolset to B2, setting the vcvars # interferes with the compiler selection. @@ -1147,8 +1146,6 @@ def add_defines(library): flags.extend(shlex.split(str(self.options.extra_b2_flags))) flags.extend([ - "install", - f"--prefix={self.package_folder}", f"-j{build_jobs(self)}", "--abbreviate-paths", f"-d{self.options.debug_level}", @@ -1375,13 +1372,25 @@ def _toolset_tag(self): #################################################################### def package(self): - # This stage/lib is in source_folder... Face palm, looks like it builds in build but then - # copy to source with the good lib name copy(self, "LICENSE_1_0.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - if self.options.header_only: - copy(self, "*", src=os.path.join(self.source_folder, "boost"), - dst=os.path.join(self.package_folder, "include", "boost")) + + if not self.options.header_only: + # Use b2 install to move files to package folder + b2_flags = " ".join(self._build_flags) + full_command = f"{self._b2_exe} {b2_flags}" + full_command += f' --debug-configuration --build-dir="{self.build_folder}" install --prefix="{self.package_folder}"' + + sources = os.path.join(self.source_folder, self._bcp_dir) if self._use_bcp else self.source_folder + with chdir(self, sources): + # To show the libraries *1 + # self.run("%s --show-libraries" % b2_exe) + self.run(full_command) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + else: + # b2 doesn't appear to support a header-only installation so explcitly copy header files + for pattern in [ "*.h", "*.hpp", "*.inc", "*.ipp" ]: + copy(self, pattern, src=os.path.join(self.source_folder, "boost"), + dst=os.path.join(self.package_folder, "include", "boost")) if self.settings.os == "Emscripten" and not self.options.header_only: self._create_emscripten_libs()