Open datgame opened 5 years ago
Hmm looks like that CMAKE_LIBRARY_ARCHITECTURE is not set in your case. You can try to add the CMAKE_LIBRARY_ARCHITECTURE and set it to "x86_64-linux-gnu". But you might need to set more stuff. The custom linux toolchain files are in externals/cmakemodules/linux, maybe you need a toolchain file on your system.
I'm not sure what all is necessary to properly fix this. But it seems to be working after the following hack (edit in response to comment: I've consistentized the casing):
After line 234 of physx/buildtools/cmake_generate_projects.py, add outString = outString + ' -DCMAKE_TOOLCHAIN_FILE=' + os.environ['PM_CMakeModules_PATH'] + '/linux/LinuxRegular.cmake'
. Then add a file externals/cmakemodules/linux/LinuxRegular.cmake containing
SET(CMAKE_CROSSCOMPILING FALSE)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSROOT ${LINUX_ROOT})
SET(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu)
Thanks, @sapphous !
That worked. Just had to fix the casing in your paste of "LinuxRegular"
After line 234 of physx/buildtools/cmake_generate_projects.py, add
outString = outString + ' -DCMAKE_TOOLCHAIN_FILE=' + os.environ['PM_CMakeModules_PATH'] + '/linux/LinuxRegular.cmake'
Then add a file externals/cmakemodules/linux/LinuxRegular.cmake containing SET(CMAKE_CROSSCOMPILING FALSE)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSROOT ${LINUX_ROOT})
SET(CMAKE_LIBRARY_ARCHITECTURE x86_64-linux-gnu)
got latest from git today (4.1) in a clean new folder and the same issue is still there. the same fix works still though.
Facing this as well. No need to add the LinuxRegular.cmake file, just add one line after https://github.com/NVIDIAGameWorks/PhysX/blob/ae80dede0546d652040ae6260a810e53e20a06fa/physx/buildtools/cmake_generate_projects.py#L263
elif self.compiler == 'clang':
+ outString = outString + ' -DCMAKE_LIBRARY_ARCHITECTURE=x86_64-linux-gnu'
After some research, using CMAKE_LIBRARY_ARCHITECTURE to detect the platform is wrong. That variable is engineered to work with Debian-derived distros, but not in general (i.e, not in RHEL, Arch, etc), see bug report mozilla and CMake docs.
The solution is to use CMAKE_CXX_COMPILER_ID
if you want to distinguish between clang, and arm. As you did for windows
in the same CMake file.
Will open a PR shortly.
CMake 3.13.2