cmake/setup-hook.sh: Don't skip build-RPATH

This should simplify using `nix-shell -A` or `nix develop` to develop
CMake based projects. CMake features a mechanism to use a different
RPATH for all executables in the build directory and only rewrite these
RPATHs on installation. This makes it possible to run executables
already from the build directory without having to set LD_LIBRARY_PATH.
This should simplify the checkPhase for cmake based projects and
hopefully not break anything.

Fixes: #22060
This commit is contained in:
Josef Kemetmüller 2021-08-20 17:25:33 +02:00 committed by Artturin
parent 116e8e939b
commit f7414e2b3a

View File

@ -102,9 +102,8 @@ cmakeConfigurePhase() {
cmakeFlags="-DBUILD_TESTING=OFF $cmakeFlags"
fi
# Avoid cmake resetting the rpath of binaries, on make install
# And build always Release, to ensure optimisation flags
cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"
# Always build Release, to ensure optimisation flags
cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} $cmakeFlags"
# Disable user package registry to avoid potential side effects
# and unecessary attempts to access non-existent home folder