Skip to content

Commit

Permalink
Merge pull request #187777 from trofi/cmake-fix-non-libc-case
Browse files Browse the repository at this point in the history
cmake: fix crash on CC without libc support
  • Loading branch information
trofi authored Aug 21, 2022
2 parents 84d30b1 + da0a5e5 commit d599919
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index b9381c3d7d..5e944640b5 100644
# CMake install location
"${_CMAKE_INSTALL_DIR}"
)
@@ -47,48 +44,46 @@ endif()
@@ -47,48 +44,48 @@ endif()

# Non "standard" but common install prefixes
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
Expand All @@ -22,7 +22,9 @@ index b9381c3d7d..5e944640b5 100644
)

# List common include file locations not under the common prefixes.
+if(IS_DIRECTORY $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()
Expand Down

0 comments on commit d599919

Please sign in to comment.