Introduce TARGET fallbacks in CMake

X86(-64) targets for cross-compilation are likely to be for a simulator/testing and not a production environment. Regardless, we do not know information about the target yet, so choose a default of core2/penryn.
This commit is contained in:
Sacha 2018-09-06 11:05:31 +10:00 committed by GitHub
parent 9e2bb0c641
commit 8450c13fb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,10 @@ if(CMAKE_CROSSCOMPILING AND NOT DEFINED TARGET)
set(TARGET "ARMV8")
elseif(ARM)
set(TARGET "ARMV7") # TODO: Ask compiler which arch this is
elseif(X86_64)
set(TARGET "PENRYN")
elseif(X86)
set(TARGET "CORE2")
else()
message(FATAL_ERROR "When cross compiling, a TARGET is required.")
endif()