boost: install BoostConfig.cmake
even when header-only (#46062)
* Install BoostConfig.cmake even when header-only * boost: Only use --without-libraries when --with-libraries would have an empty list
This commit is contained in:
parent
85487f23bc
commit
b9e4e98f15
@ -497,7 +497,7 @@ def bjam_python_line(self, spec):
|
|||||||
spec["python"].libs[0],
|
spec["python"].libs[0],
|
||||||
)
|
)
|
||||||
|
|
||||||
def determine_bootstrap_options(self, spec, with_libs, options):
|
def determine_bootstrap_options(self, spec, with_libs, without_libs, options):
|
||||||
boost_toolset_id = self.determine_toolset(spec)
|
boost_toolset_id = self.determine_toolset(spec)
|
||||||
|
|
||||||
# Arm compiler bootstraps with 'gcc' (but builds as 'clang')
|
# Arm compiler bootstraps with 'gcc' (but builds as 'clang')
|
||||||
@ -505,7 +505,10 @@ def determine_bootstrap_options(self, spec, with_libs, options):
|
|||||||
options.append("--with-toolset=gcc")
|
options.append("--with-toolset=gcc")
|
||||||
else:
|
else:
|
||||||
options.append("--with-toolset=%s" % boost_toolset_id)
|
options.append("--with-toolset=%s" % boost_toolset_id)
|
||||||
options.append("--with-libraries=%s" % ",".join(with_libs))
|
if with_libs:
|
||||||
|
options.append("--with-libraries=%s" % ",".join(with_libs))
|
||||||
|
else:
|
||||||
|
options.append("--without-libraries=%s" % ",".join(without_libs))
|
||||||
|
|
||||||
if spec.satisfies("+python"):
|
if spec.satisfies("+python"):
|
||||||
options.append("--with-python=%s" % spec["python"].command.path)
|
options.append("--with-python=%s" % spec["python"].command.path)
|
||||||
@ -677,43 +680,46 @@ def install(self, spec, prefix):
|
|||||||
env["PATH"] = newdir + ":" + env["PATH"]
|
env["PATH"] = newdir + ":" + env["PATH"]
|
||||||
|
|
||||||
with_libs = list()
|
with_libs = list()
|
||||||
|
without_libs = list()
|
||||||
for lib in Boost.all_libs:
|
for lib in Boost.all_libs:
|
||||||
if "+{0}".format(lib) in spec:
|
if "+{0}".format(lib) in spec:
|
||||||
with_libs.append(lib)
|
with_libs.append(lib)
|
||||||
|
else:
|
||||||
|
without_libs.append(lib)
|
||||||
|
|
||||||
|
remove_if_in_list = lambda lib, libs: libs.remove(lib) if lib in libs else None
|
||||||
|
|
||||||
# Remove libraries that the release version does not support
|
# Remove libraries that the release version does not support
|
||||||
if spec.satisfies("@1.69.0:") and "signals" in with_libs:
|
if spec.satisfies("@1.69.0:"):
|
||||||
with_libs.remove("signals")
|
remove_if_in_list("signals", with_libs)
|
||||||
if not spec.satisfies("@1.54.0:") and "log" in with_libs:
|
remove_if_in_list("signals", without_libs)
|
||||||
with_libs.remove("log")
|
if not spec.satisfies("@1.54.0:"):
|
||||||
if not spec.satisfies("@1.53.0:") and "atomic" in with_libs:
|
remove_if_in_list("log", with_libs)
|
||||||
with_libs.remove("atomic")
|
remove_if_in_list("log", without_libs)
|
||||||
if not spec.satisfies("@1.48.0:") and "locale" in with_libs:
|
if not spec.satisfies("@1.53.0:"):
|
||||||
with_libs.remove("locale")
|
remove_if_in_list("atomic", with_libs)
|
||||||
if not spec.satisfies("@1.47.0:") and "chrono" in with_libs:
|
remove_if_in_list("atomic", without_libs)
|
||||||
with_libs.remove("chrono")
|
if not spec.satisfies("@1.48.0:"):
|
||||||
if not spec.satisfies("@1.43.0:") and "random" in with_libs:
|
remove_if_in_list("locale", with_libs)
|
||||||
with_libs.remove("random")
|
remove_if_in_list("locale", without_libs)
|
||||||
if not spec.satisfies("@1.39.0:") and "exception" in with_libs:
|
if not spec.satisfies("@1.47.0:"):
|
||||||
with_libs.remove("exception")
|
remove_if_in_list("chrono", with_libs)
|
||||||
|
remove_if_in_list("chrono", without_libs)
|
||||||
|
if not spec.satisfies("@1.43.0:"):
|
||||||
|
remove_if_in_list("random", with_libs)
|
||||||
|
remove_if_in_list("random", without_libs)
|
||||||
|
if not spec.satisfies("@1.39.0:"):
|
||||||
|
remove_if_in_list("exception", with_libs)
|
||||||
|
remove_if_in_list("exception", without_libs)
|
||||||
if spec.satisfies("+graph") and spec.satisfies("+mpi"):
|
if spec.satisfies("+graph") and spec.satisfies("+mpi"):
|
||||||
with_libs.append("graph_parallel")
|
with_libs.append("graph_parallel")
|
||||||
|
remove_if_in_list("graph_parallel", without_libs)
|
||||||
if not with_libs:
|
|
||||||
# if no libraries are specified for compilation, then you dont have
|
|
||||||
# to configure/build anything, just copy over to the prefix
|
|
||||||
# directory.
|
|
||||||
src = join_path(self.stage.source_path, "boost")
|
|
||||||
mkdirp(join_path(prefix, "include"))
|
|
||||||
dst = join_path(prefix, "include", "boost")
|
|
||||||
install_tree(src, dst)
|
|
||||||
return
|
|
||||||
|
|
||||||
# to make Boost find the user-config.jam
|
# to make Boost find the user-config.jam
|
||||||
env["BOOST_BUILD_PATH"] = self.stage.source_path
|
env["BOOST_BUILD_PATH"] = self.stage.source_path
|
||||||
|
|
||||||
bootstrap_options = ["--prefix=%s" % prefix]
|
bootstrap_options = ["--prefix=%s" % prefix]
|
||||||
self.determine_bootstrap_options(spec, with_libs, bootstrap_options)
|
self.determine_bootstrap_options(spec, with_libs, without_libs, bootstrap_options)
|
||||||
|
|
||||||
if self.spec.satisfies("platform=windows"):
|
if self.spec.satisfies("platform=windows"):
|
||||||
bootstrap = Executable("cmd.exe")
|
bootstrap = Executable("cmd.exe")
|
||||||
|
Loading…
Reference in New Issue
Block a user