CMake: If target arch cannot be detected, don't throw an error

This only happens when ccache is improperly in use and -dumpmachine
doesn't work. Not on our ARM build platform.
This commit is contained in:
Michael Friedrich 2019-08-08 19:26:10 +02:00
parent 4e8ae223a5
commit c89ffe408d
1 changed files with 3 additions and 3 deletions

View File

@ -390,12 +390,12 @@ if(NOT MSVC)
)
if (RESULT)
message(FATAL_ERROR "Failed to detect target architecture: ${RESULT}")
message(STATUS "Failed to detect target architecture with compiler ${CMAKE_C_COMPILER}: ${RESULT}")
endif()
string(REGEX MATCH "([^-]+).*" ARCH_MATCH ${ARCH})
string(REGEX MATCH "([^-]+).*" ARCH_MATCH "${ARCH}")
if (NOT CMAKE_MATCH_1 OR NOT ARCH_MATCH)
message(FATAL_ERROR "Failed to match the target architecture: ${ARCH}")
message(STATUS "Failed to match the target architecture: ${ARCH}")
endif()
set(ARCH ${CMAKE_MATCH_1})