Skip to content

Commit

Permalink
CMake: Do not use CMAKE_LIBRARY_ARCHITECTURE for linux
Browse files Browse the repository at this point in the history
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 NVIDIAGameWorks#39

Signed-off-by: ns <[email protected]>
  • Loading branch information
phcerdan authored and qoh committed Jan 13, 2020
1 parent 333e713 commit d069b75
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions externals/cmakemodules/GetCompilerAndPlatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d069b75

Please sign in to comment.