summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/cmake/setup-hook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/build-managers/cmake/setup-hook.sh')
-rwxr-xr-xpkgs/development/tools/build-managers/cmake/setup-hook.sh25
1 files changed, 11 insertions, 14 deletions
diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
index 5053559bcca3..733dd9482200 100755
--- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh
+++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
@@ -29,20 +29,17 @@ cmakeConfigurePhase() {
         cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix $cmakeFlags"
     fi
 
-    if [ -n "$crossConfig" ]; then
-        # By now it supports linux builds only. We should set the proper
-        # CMAKE_SYSTEM_NAME otherwise.
-        # http://www.cmake.org/Wiki/CMake_Cross_Compiling
-        #
-        # Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
-        # strip. Otherwise they are taken to be relative to the source root of
-        # the package being built.
-        cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-c++ $cmakeFlags"
-        cmakeFlags="-DCMAKE_C_COMPILER=$crossConfig-cc $cmakeFlags"
-        cmakeFlags="-DCMAKE_AR=$(command -v $crossConfig-ar) $cmakeFlags"
-        cmakeFlags="-DCMAKE_RANLIB=$(command -v $crossConfig-ranlib) $cmakeFlags"
-        cmakeFlags="-DCMAKE_STRIP=$(command -v $crossConfig-strip) $cmakeFlags"
-    fi
+    # We should set the proper `CMAKE_SYSTEM_NAME`.
+    # http://www.cmake.org/Wiki/CMake_Cross_Compiling
+    #
+    # Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
+    # strip. Otherwise they are taken to be relative to the source root of the
+    # package being built.
+    cmakeFlags="-DCMAKE_CXX_COMPILER=$CXX $cmakeFlags"
+    cmakeFlags="-DCMAKE_C_COMPILER=$CC $cmakeFlags"
+    cmakeFlags="-DCMAKE_AR=$(command -v $AR) $cmakeFlags"
+    cmakeFlags="-DCMAKE_RANLIB=$(command -v $RANLAB) $cmakeFlags"
+    cmakeFlags="-DCMAKE_STRIP=$(command -v $STRIP) $cmakeFlags"
 
     # on macOS we want to prefer Unix-style headers to Frameworks
     # because we usually do not package the framework