summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorarcnmx <arcnmx@users.noreply.github.com>2019-07-27 15:18:33 -0700
committerarcnmx <arcnmx@users.noreply.github.com>2019-07-27 15:23:31 -0700
commit8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee (patch)
tree06323938c696f14d39faa652ad4734ae87d19c9f /pkgs/stdenv
parentb5590fff46b85fec36ceac6a84b29b4c4eb8c3f7 (diff)
downloadnixpkgs-8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee.tar
nixpkgs-8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee.tar.gz
nixpkgs-8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee.tar.bz2
nixpkgs-8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee.tar.lz
nixpkgs-8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee.tar.xz
nixpkgs-8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee.tar.zst
nixpkgs-8cedc7fc6cca524fa3f27d5b70774aad8b4c67ee.zip
stdenv: correct cross CMAKE_SYSTEM_NAME
As described in cmake cross instructions, CMAKE_SYSTEM_NAME should be
set to "Generic" if there is no applicable OS:

https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling#setting-up-the-system-and-toolchain
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index be79e7626c5..a11b280b047 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -246,7 +246,7 @@ in rec {
             (/**/ if lib.isString cmakeFlags then [cmakeFlags]
              else if cmakeFlags == null      then []
              else                                     cmakeFlags)
-          ++ lib.optional (stdenv.hostPlatform.uname.system != null) "-DCMAKE_SYSTEM_NAME=${stdenv.hostPlatform.uname.system}"
+          ++ [ "-DCMAKE_SYSTEM_NAME=${lib.findFirst lib.isString "Generic" [ stdenv.hostPlatform.uname.system ]}" ]
           ++ lib.optional (stdenv.hostPlatform.uname.processor != null) "-DCMAKE_SYSTEM_PROCESSOR=${stdenv.hostPlatform.uname.processor}"
           ++ lib.optional (stdenv.hostPlatform.uname.release != null) "-DCMAKE_SYSTEM_VERSION=${stdenv.hostPlatform.release}"
           ++ lib.optional (stdenv.buildPlatform.uname.system != null) "-DCMAKE_HOST_SYSTEM_NAME=${stdenv.buildPlatform.uname.system}"