From 5245e7324b185886a4627afcb19b137fe52bcb0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BE=E5=9C=B0=20=E5=B8=8C=E7=95=99=E8=80=B6?= <65301509+KiruyaMomochi@users.noreply.github.com> Date: Wed, 2 Nov 2022 02:26:33 +0800 Subject: [PATCH] cmake: put the `DEFINED` check in the same if-statement --- .../build-managers/cmake/001-search-path.diff | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pkgs/development/tools/build-managers/cmake/001-search-path.diff b/pkgs/development/tools/build-managers/cmake/001-search-path.diff index 8f62da333f0e..04ab0847a707 100644 --- a/pkgs/development/tools/build-managers/cmake/001-search-path.diff +++ b/pkgs/development/tools/build-managers/cmake/001-search-path.diff @@ -12,7 +12,7 @@ index b9381c3d7d..5e944640b5 100644 # CMake install location "${_CMAKE_INSTALL_DIR}" ) -@@ -47,48 +44,50 @@ endif() +@@ -47,48 +44,49 @@ endif() # Non "standard" but common install prefixes list(APPEND CMAKE_SYSTEM_PREFIX_PATH @@ -22,16 +22,15 @@ index b9381c3d7d..5e944640b5 100644 ) # List common include file locations not under the common prefixes. -+if(DEFINED ENV{NIX_CC}) -+ if(IS_DIRECTORY "$ENV{NIX_CC}" -+ AND EXISTS "$ENV{NIX_CC}/nix-support/orig-libc" -+ AND EXISTS "$ENV{NIX_CC}/nix-support/orig-libc-dev") -+ file(STRINGS "$ENV{NIX_CC}/nix-support/orig-libc" _nix_cmake_libc) -+ file(STRINGS "$ENV{NIX_CC}/nix-support/orig-libc-dev" _nix_cmake_libc_dev) -+ else() -+ set(_nix_cmake_libc @libc_lib@) -+ set(_nix_cmake_libc_dev @libc_dev@) -+ endif() ++if(DEFINED ENV{NIX_CC} ++ AND IS_DIRECTORY "$ENV{NIX_CC}" ++ AND EXISTS "$ENV{NIX_CC}/nix-support/orig-libc" ++ AND EXISTS "$ENV{NIX_CC}/nix-support/orig-libc-dev") ++ file(STRINGS "$ENV{NIX_CC}/nix-support/orig-libc" _nix_cmake_libc) ++ file(STRINGS "$ENV{NIX_CC}/nix-support/orig-libc-dev" _nix_cmake_libc_dev) ++else() ++ set(_nix_cmake_libc @libc_lib@) ++ set(_nix_cmake_libc_dev @libc_dev@) +endif() + list(APPEND CMAKE_SYSTEM_INCLUDE_PATH