Skip to content

Commit

Permalink
cmake/setup-hook.sh: Don't skip build-RPATH
Browse files Browse the repository at this point in the history
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
  • Loading branch information
knedlsepp authored and Artturin committed Jul 3, 2022
1 parent 116e8e9 commit f7414e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkgs/development/tools/build-managers/cmake/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f7414e2

Please sign in to comment.