From f7414e2b3ac69f220e19b1ef9ddfe8d64650c5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kemetm=C3=BCller?= Date: Fri, 20 Aug 2021 17:25:33 +0200 Subject: [PATCH] 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 --- pkgs/development/tools/build-managers/cmake/setup-hook.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 89e8e0e197a0..50f23f1bb7b1 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -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