diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2019-12-11 22:50:50 -0800 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2019-12-25 11:19:28 +0100 |
| commit | 550f98395c8677ae9b08ec39433f5137e5cea2c8 (patch) | |
| tree | e3532e6fb7e59860c0b143ffc4b1aef11b3fe331 | |
| parent | fdf1593772089897beee7b752273a450db5d6423 (diff) | |
| download | Project-Tick-550f98395c8677ae9b08ec39433f5137e5cea2c8.tar.gz Project-Tick-550f98395c8677ae9b08ec39433f5137e5cea2c8.zip | |
Set arch based on target compiler if cross compiling.
| -rw-r--r-- | cmake/archdetect.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/archdetect.cmake b/cmake/archdetect.cmake index 9f8d1c1074..9a8b9881e2 100644 --- a/cmake/archdetect.cmake +++ b/cmake/archdetect.cmake @@ -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") |
