3
0
Fork 0
forked from mirrors/nixpkgs

Revert "cmake: use supplied RPATH instead of guessing"

This reverts commit 8ec5adc953.

This broke stdenv on Darwin, see #15881. A Darwin user will need to fix
the problem and un-revert. This commit causes CMake to use the same
RPATH settings as the compiler, so it is obviously correct.
This commit is contained in:
Thomas Tuegel 2016-05-31 16:30:15 -05:00
parent 7285c2e107
commit d5d4606190

View file

@ -47,15 +47,9 @@ cmakeConfigurePhase() {
cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags"
# Always build Release, to ensure optimisation flags.
cmakeFlags="-DCMAKE_BUILD_TYPE=Release $cmakeFlags"
# Do not change the RPATH between build and install, simply
# build with the correct RPATH in the first place.
cmakeFlags="-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE $cmakeFlags"
# Do not try to guess the correct RPATH based on linker flags.
cmakeFlags="-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE $cmakeFlags"
# Just use exactly our RPATH.
cmakeFlags="-DCMAKE_INSTALL_RPATH=$CMAKE_INSTALL_RPATH $cmakeFlags"
# Avoid cmake resetting the rpath of binaries, on make install
# And build always Release, to ensure optimisation flags
cmakeFlags="-DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"
echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"
@ -83,7 +77,6 @@ makeCmakeFindLibs(){
;;
-L*)
export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}"
export CMAKE_INSTALL_RPATH="$CMAKE_INSTALL_RPATH${CMAKE_INSTALL_RPATH:+:}${flag:2}"
;;
esac
done