Merge pull request #7409 from Icinga/bugfix/cmake-target-arch

CMake: If target arch cannot be detected, don't throw an error
This commit is contained in:
Michael Friedrich 2019-08-12 11:02:33 +02:00 committed by GitHub
commit 104a75b59c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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})