Skip to content

Commit

Permalink
pixi: Improve LDFLAGS definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Oct 25, 2024
1 parent 77a42bb commit 7e02088
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/activation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@ unset DEBUG_CPPFLAGS
unset DEBUG_CXXFLAGS
unset LDFLAGS

# On OSX it's really important to setup these linker path or the linker
# will use the system libc++ that can be incompatible with our dependencies
export LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
export &> /tmp/a

if [[ $host_alias == *"apple"* ]];
then
# On OSX setting the rpath and -L it's important to use the conda libc++ instead of the system one.
# If conda-forge use install_name_tool to package some libs, -headerpad_max_install_names is then mandatory
export LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
elif [[ $host_alias == *"linux"* ]];
then
# On GNU/Linux, I don't know if these flags are mandatory with g++ but
# it allow to use clang++ as compiler
export LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
fi

# Setup ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
Expand Down

0 comments on commit 7e02088

Please sign in to comment.