From d069b75514e1d4608480f1f54ae162fcad4bd3d6 Mon Sep 17 00:00:00 2001 From: Pablo Hernandez-Cerdan Date: Wed, 6 Nov 2019 20:06:59 +0100 Subject: [PATCH] CMake: Do not use CMAKE_LIBRARY_ARCHITECTURE for linux CMAKE_LIBRARY_ARCHITECTURE is engineered for Debian-derived linux, not for other distros such as RHEL-derived, Arch, etc. To detect compilers in GetCompilerAndPlatform, use instead `CMAKE_CXX_COMPILER_ID` and `CMAKE_CXX_COMPILER`, as it is used already for the `windows` case. Note that the arm version is untested, so a double check with COMPILER_ID and just COMPILER is in place. Fixes #39 Signed-off-by: ns --- externals/cmakemodules/GetCompilerAndPlatform.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/externals/cmakemodules/GetCompilerAndPlatform.cmake b/externals/cmakemodules/GetCompilerAndPlatform.cmake index efaee8805..7b712d19d 100644 --- a/externals/cmakemodules/GetCompilerAndPlatform.cmake +++ b/externals/cmakemodules/GetCompilerAndPlatform.cmake @@ -117,9 +117,10 @@ FUNCTION (GetPlatformBinName PLATFORM_BIN_NAME LIBPATH_SUFFIX) ELSEIF(TARGET_BUILD_PLATFORM STREQUAL "android") SET(RETVAL "android.${ANDROID_ABI}.fp-soft") ELSEIF(TARGET_BUILD_PLATFORM STREQUAL "linux") - IF (${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "x86_64-unknown-linux-gnu" OR ${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "x86_64-linux-gnu") + IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") SET(RETVAL "linux.clang") - ELSEIF(${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-unknown-linux-gnueabi" OR ${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu") + ELSEIF(${CMAKE_CXX_COMPILER_ID} MATCHES "^ARM.*" + OR ${CMAKE_CXX_COMPILER} MATCHES "arm") SET(RETVAL "linux.aarch64") ENDIF() ENDIF()