From 07f3095745fa9bc664c43c124cedca692b60e110 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 13 Jan 2023 20:35:33 -0800 Subject: [PATCH] Fix compiling for 32-bit Linux --- physx/source/compiler/cmake/linux/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/physx/source/compiler/cmake/linux/CMakeLists.txt b/physx/source/compiler/cmake/linux/CMakeLists.txt index aba53365a..c9a1e969f 100644 --- a/physx/source/compiler/cmake/linux/CMakeLists.txt +++ b/physx/source/compiler/cmake/linux/CMakeLists.txt @@ -36,6 +36,11 @@ IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") SET(PHYSX_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -fstrict-aliasing ${CLANG_WARNINGS}" CACHE INTERNAL "PhysX CXX") ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") SET(PHYSX_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -fno-strict-aliasing ${GCC_WARNINGS}" CACHE INTERNAL "PhysX CXX") + + # Enable SSE2 and fix double alignment for 32-bit x86 builds + IF (CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*") + STRING(APPEND PHYSX_CXX_FLAGS " -malign-double -msse2") + ENDIF() ENDIF() # Build debug info for all configurations