Skip to content

Commit e40efe6

Browse files
committed
pixi: Improve LDFLAGS definition
1 parent bf8099b commit e40efe6

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/activation.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ unset DEBUG_CPPFLAGS
1010
unset DEBUG_CXXFLAGS
1111
unset LDFLAGS
1212

13-
# On OSX it's really important to setup these linker path or the linker
14-
# will use the system libc++ that can be incompatible with our dependencies
15-
export LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
13+
if [[ $host_alias == *"apple"* ]];
14+
then
15+
# On OSX setting the rpath and -L it's important to use the conda libc++ instead of the system one.
16+
# If conda-forge use install_name_tool to package some libs, -headerpad_max_install_names is then mandatory
17+
export LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
18+
elif [[ $host_alias == *"linux"* ]];
19+
then
20+
# On GNU/Linux, I don't know if these flags are mandatory with g++ but
21+
# it allow to use clang++ as compiler
22+
export LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
23+
fi
1624

1725
# Setup ccache
1826
export CMAKE_CXX_COMPILER_LAUNCHER=ccache

0 commit comments

Comments
 (0)