1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 14:41:17 +00:00

Merge pull request #55046 from FlorianFranzen/cmake_no_pkg_reg

cmake: disable package registry
This commit is contained in:
Franz Pletz 2019-02-03 08:32:43 +00:00 committed by GitHub
commit 97507ffc8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,13 @@ cmakeConfigurePhase() {
# And build always Release, to ensure optimisation flags
cmakeFlags="-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release} -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"
# Disable user package registry to avoid potential side effects
# and unecessary attempts to access non-existent home folder
# https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#disabling-the-package-registry
cmakeFlags="-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON $cmakeFlags"
cmakeFlags="-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON $cmakeFlags"
cmakeFlags="-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON $cmakeFlags"
if [ "$buildPhase" = ninjaBuildPhase ]; then
cmakeFlags="-GNinja $cmakeFlags"
fi