mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
[SCons] Workaround for SCons ignoring RPATH in sample SConstruct files
This commit is contained in:
parent
cb02c5ccbb
commit
c67d003c2f
@ -21,6 +21,11 @@ for programName, sources in samples:
|
|||||||
linkflags.append(f"-Wl,-rpath,{localenv['ct_shlibdir']}")
|
linkflags.append(f"-Wl,-rpath,{localenv['ct_shlibdir']}")
|
||||||
libdirs.extend(localenv["extra_lib_dirs"])
|
libdirs.extend(localenv["extra_lib_dirs"])
|
||||||
|
|
||||||
|
if env["OS"] == "Darwin" and env["use_rpath_linkage"] and not env.subst("$__RPATH"):
|
||||||
|
# SCons fails to specify RPATH on macOS, so circumvent that behavior by
|
||||||
|
# specifying this directly as part of LINKFLAGS
|
||||||
|
linkflags.extend(env.subst(f'$RPATHPREFIX{d}$RPATHSUFFIX') for d in libdirs)
|
||||||
|
|
||||||
localenv["tmpl_compiler_flags"] = repr(localenv["CCFLAGS"])
|
localenv["tmpl_compiler_flags"] = repr(localenv["CCFLAGS"])
|
||||||
localenv['tmpl_cantera_incdirs'] = repr([x for x in incdirs if x])
|
localenv['tmpl_cantera_incdirs'] = repr([x for x in incdirs if x])
|
||||||
localenv['tmpl_cantera_libs'] = repr(localenv['cantera_shared_libs'])
|
localenv['tmpl_cantera_libs'] = repr(localenv['cantera_shared_libs'])
|
||||||
|
@ -71,6 +71,12 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}
|
|||||||
libdirs.extend(localenv["extra_lib_dirs"])
|
libdirs.extend(localenv["extra_lib_dirs"])
|
||||||
libdirs = list(set(libdirs))
|
libdirs = list(set(libdirs))
|
||||||
|
|
||||||
|
if env["OS"] == "Darwin" and env["use_rpath_linkage"] and not env.subst("$__RPATH"):
|
||||||
|
# SCons fails to specify RPATH on macOS, so circumvent that behavior by
|
||||||
|
# specifying this directly as part of LINKFLAGS
|
||||||
|
localenv.Append(LINKFLAGS=[env.subst(f'$RPATHPREFIX{d}$RPATHSUFFIX')
|
||||||
|
for d in libdirs])
|
||||||
|
|
||||||
cc_flags = compiler_flag_list(localenv["CCFLAGS"] + localenv["CXXFLAGS"],
|
cc_flags = compiler_flag_list(localenv["CCFLAGS"] + localenv["CXXFLAGS"],
|
||||||
flag_excludes)
|
flag_excludes)
|
||||||
localenv["tmpl_compiler_flags"] = repr(cc_flags)
|
localenv["tmpl_compiler_flags"] = repr(cc_flags)
|
||||||
|
Loading…
Reference in New Issue
Block a user