Skip to content

Commit

Permalink
Use ${CMAKE_SYSTEM_PROCESSOR} to determine target architecture instea…
Browse files Browse the repository at this point in the history
…d of guessing using the linker search path.

This method works on Arch Linux and related distros that do not prefix their library paths.
Fixes NVIDIAGameWorks#39.
  • Loading branch information
no-preserve-root committed Sep 5, 2019
1 parent ae80ded commit d988ed7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions externals/cmakemodules/GetCompilerAndPlatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +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")
SET(RETVAL "linux.clang")
ELSEIF(${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-unknown-linux-gnueabi" OR ${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu")
SET(RETVAL "linux.aarch64")
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
SET(RETVAL "linux.clang")
ELSEIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(RETVAL "linux.aarch64")
ENDIF()
ENDIF()

Expand Down
2 changes: 1 addition & 1 deletion physx/snippets/compiler/cmake/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath='$ORIGIN'")
# Include all of the projects
SET(PLATFORM_SNIPPETS_LIST Convert LoadCollection)

IF(${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu")
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(SNIPPET_RENDER_ENABLED 0)
ELSE()
SET(SNIPPET_RENDER_ENABLED 1)
Expand Down
4 changes: 2 additions & 2 deletions physx/snippets/compiler/cmake/linux/SnippetTemplate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Build Snippet linux template
#

IF(${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu")
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(SNIPPET_COMPILE_DEFS
# Common to all configurations

Expand Down Expand Up @@ -71,7 +71,7 @@ IF(${SNIPPET_NAME} STREQUAL "ArticulationLoader")
)
ENDIF()

IF(${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu")
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(SNIPPET_PLATFORM_LINKED_LIBS
rt pthread dl
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Build SnippetVehicle linux template
#

IF(${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu")
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(SNIPPET_COMPILE_DEFS
# Common to all configurations

Expand Down Expand Up @@ -61,7 +61,7 @@ SET(SNIPPET_PLATFORM_INCLUDES

)

IF(${CMAKE_LIBRARY_ARCHITECTURE} STREQUAL "aarch64-linux-gnu")
IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
SET(SNIPPET_PLATFORM_LINKED_LIBS
rt pthread dl
)
Expand Down

0 comments on commit d988ed7

Please sign in to comment.