CachedCMakePackage: set CMAKE_*_RPATH with implicit and extra rpaths (#48067)
This is useful when CachedCMakePackage is used without the Spack compiler wrapper.
This commit is contained in:
parent
4be7b98fd2
commit
7328c64fc7
@ -298,7 +298,14 @@ def initconfig_hardware_entries(self):
|
||||
def std_initconfig_entries(self):
|
||||
cmake_prefix_path_env = os.environ["CMAKE_PREFIX_PATH"]
|
||||
cmake_prefix_path = cmake_prefix_path_env.replace(os.pathsep, ";")
|
||||
|
||||
complete_rpath_list = ";".join(
|
||||
[
|
||||
self.pkg.spec.prefix.lib,
|
||||
self.pkg.spec.prefix.lib64,
|
||||
*os.environ.get("SPACK_COMPILER_EXTRA_RPATHS", "").split(":"),
|
||||
*os.environ.get("SPACK_COMPILER_IMPLICIT_RPATHS", "").split(":"),
|
||||
]
|
||||
)
|
||||
return [
|
||||
"#------------------{0}".format("-" * 60),
|
||||
"# !!!! This is a generated file, edit at own risk !!!!",
|
||||
@ -307,6 +314,8 @@ def std_initconfig_entries(self):
|
||||
"#------------------{0}\n".format("-" * 60),
|
||||
cmake_cache_string("CMAKE_PREFIX_PATH", cmake_prefix_path),
|
||||
cmake_cache_string("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "ON"),
|
||||
cmake_cache_string("CMAKE_BUILD_RPATH", complete_rpath_list),
|
||||
cmake_cache_string("CMAKE_INSTALL_RPATH", complete_rpath_list),
|
||||
self.define_cmake_cache_from_variant("CMAKE_BUILD_TYPE", "build_type"),
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user