]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Set arch based on target compiler if cross compiling.
authorNathan Moinvaziri <nathan@nathanm.com>
Thu, 12 Dec 2019 06:50:50 +0000 (22:50 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 25 Dec 2019 10:19:28 +0000 (11:19 +0100)
cmake/archdetect.cmake

index 9f8d1c1074a075dd53080520c777dc53ed51af26..9a8b9881e2d9907b787dad53ad36787d1b458fcd 100644 (file)
@@ -16,6 +16,8 @@ elseif(MSVC)
     elseif ("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "ARM64")
         set(ARCH "aarch64")
     endif()
+elseif(CMAKE_CROSSCOMPILING)
+    set(ARCH ${CMAKE_C_COMPILER_TARGET})
 else()
     # Let preprocessor parse archdetect.c and raise an error containing the arch identifier
     enable_language(C)
@@ -51,7 +53,7 @@ if("${ARCH}" MATCHES "(x86_64|AMD64|i[3-6]86)")
 elseif("${ARCH}" MATCHES "(arm(v[0-9])?|aarch64)")
     set(BASEARCH "arm")
     set(BASEARCH_ARM_FOUND TRUE)
-elseif("${ARCH}" MATCHES "ppc(64)?")
+elseif("${ARCH}" MATCHES "ppc(64)?|powerpc(64)?")
     set(BASEARCH "ppc")
     set(BASEARCH_PPC_FOUND TRUE)
 elseif("${ARCH}" MATCHES "alpha")