diff --git a/.github/workflows/build-physx.yml b/.github/workflows/build-physx.yml index 4798ec4..89a7c09 100644 --- a/.github/workflows/build-physx.yml +++ b/.github/workflows/build-physx.yml @@ -8,9 +8,9 @@ jobs: steps: - name: Clone PhysX 4.1 run: git clone -b 4.1 https://github.com/NVIDIAGameWorks/PhysX - - name: Inject bug fix into cmake + - name: Copy fixed CMakeLists #Added: -Wno-alloca - run: echo 'SET(PHYSX_CXX_FLAGS "${OSX_BITNESS} -msse2 -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -Wno-alloca -Werror -ferror-limit=0 -Wall -Wextra -fstrict-aliasing -Wstrict-aliasing=2 -Weverything -Wno-unknown-warning-option -Wno-documentation-deprecated-sync -Wno-documentation-unknown-command -Wno-float-equal -Wno-padded -Wno-weak-vtables -Wno-cast-align -Wno-conversion -Wno-missing-noreturn -Wno-missing-variable-declarations -Wno-shift-sign-overflow -Wno-covered-switch-default -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes -Wno-unreachable-code -Wno-unused-macros -Wno-unused-member-function -Wno-used-but-marked-unused -Wno-weak-template-vtables -Wno-deprecated -Wno-non-virtual-dtor -Wno-invalid-noreturn -Wno-return-type-c-linkage -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-unused-local-typedef -Wno-old-style-cast -Wno-newline-eof -Wno-unused-private-field -Wno-undefined-reinterpret-cast -Wno-invalid-offsetof -Wno-zero-as-null-pointer-constant -Wno-atomic-implicit-seq-cst -gdwarf-2" CACHE INTERNAL "PhysX CXX")' >> ./PhysX/physx/source/compiler/cmake/mac/CMakeLists.txt + run: cp ./macCMakeLists.txt ./PhysX/physx/source/compiler/cmake/mac/CMakeLists.txt - name: Check Cmake run: cat ./PhysX/physx/source/compiler/cmake/mac/CMakeLists.txt - name: Generate xcode project diff --git a/macCMakeLists.txt b/macCMakeLists.txt new file mode 100644 index 0000000..958c2d7 --- /dev/null +++ b/macCMakeLists.txt @@ -0,0 +1,99 @@ +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## * Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## * Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## * Neither the name of NVIDIA CORPORATION nor the names of its +## contributors may be used to endorse or promote products derived +## from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY +## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +## +## Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved. + +SET(OSX_BITNESS "-arch x86_64") +SET(CMAKE_OSX_ARCHITECTURES "x86_64") + +SET(PHYSX_CXX_FLAGS "${OSX_BITNESS} -msse2 -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -Wno-alloca -Werror -ferror-limit=0 -Wall -Wextra -fstrict-aliasing -Wstrict-aliasing=2 -Weverything -Wno-unknown-warning-option -Wno-documentation-deprecated-sync -Wno-documentation-unknown-command -Wno-float-equal -Wno-padded -Wno-weak-vtables -Wno-cast-align -Wno-conversion -Wno-missing-noreturn -Wno-missing-variable-declarations -Wno-shift-sign-overflow -Wno-covered-switch-default -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes -Wno-unreachable-code -Wno-unused-macros -Wno-unused-member-function -Wno-used-but-marked-unused -Wno-weak-template-vtables -Wno-deprecated -Wno-non-virtual-dtor -Wno-invalid-noreturn -Wno-return-type-c-linkage -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-unused-local-typedef -Wno-old-style-cast -Wno-newline-eof -Wno-unused-private-field -Wno-undefined-reinterpret-cast -Wno-invalid-offsetof -Wno-zero-as-null-pointer-constant -Wno-atomic-implicit-seq-cst -gdwarf-2" CACHE INTERNAL "PhysX CXX") + +SET(CMAKE_SHARED_LINKER_FLAGS_CHECKED "") +SET(CMAKE_SHARED_LINKER_FLAGS_PROFILE "") +SET(CMAKE_SHARED_LINKER_FLAGS "") + +# Build debug info for all configurations +SET(PHYSX_CXX_FLAGS_DEBUG "-O0 -g" CACHE INTERNAL "PhysX Debug CXX Flags") +SET(PHYSX_CXX_FLAGS_CHECKED "-O3 -g" CACHE INTERNAL "PhysX Checked CXX Flags") +SET(PHYSX_CXX_FLAGS_PROFILE "-O3 -g" CACHE INTERNAL "PhysX Profile CXX Flags") +SET(PHYSX_CXX_FLAGS_RELEASE "-O3 -g" CACHE INTERNAL "PhysX Release CXX Flags") + +# These flags are local to the directory the CMakeLists.txt is in +SET(CMAKE_CXX_FLAGS ${PHYSX_CXX_FLAGS}) + +SET(CMAKE_CXX_FLAGS_DEBUG ${PHYSX_CXX_FLAGS_DEBUG}) +SET(CMAKE_CXX_FLAGS_CHECKED ${PHYSX_CXX_FLAGS_CHECKED}) +SET(CMAKE_CXX_FLAGS_PROFILE ${PHYSX_CXX_FLAGS_PROFILE}) +SET(CMAKE_CXX_FLAGS_RELEASE ${PHYSX_CXX_FLAGS_RELEASE}) + +# Build libs compatible with OS X 10.9 +SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.9") + +#set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym") + +# Controls PX_NVTX for all projects on Mac +SET(NVTX_FLAG "PX_NVTX=0") + +# Disable cuda for all projects +SET(PHYSX_MAC_COMPILE_DEFS "DISABLE_CUDA_PHYSX;${PHYSX_AUTOBUILD}" CACHE INTERNAL "Base PhysX preprocessor definitions") +SET(PHYSX_MAC_DEBUG_COMPILE_DEFS "_DEBUG;PX_DEBUG=1;PX_CHECKED=1;${NVTX_FLAG};PX_SUPPORT_PVD=1" CACHE INTERNAL "Debug PhysX preprocessor definitions") +SET(PHYSX_MAC_CHECKED_COMPILE_DEFS "NDEBUG;PX_CHECKED=1;${NVTX_FLAG};PX_SUPPORT_PVD=1" CACHE INTERNAL "Checked PhysX preprocessor definitions") +SET(PHYSX_MAC_PROFILE_COMPILE_DEFS "NDEBUG;PX_PROFILE=1;${NVTX_FLAG};PX_SUPPORT_PVD=1" CACHE INTERNAL "Profile PhysX preprocessor definitions") +SET(PHYSX_MAC_RELEASE_COMPILE_DEFS "NDEBUG;PX_SUPPORT_PVD=0" CACHE INTERNAL "Release PhysX preprocessor definitions") + + +# Include all of the projects +INCLUDE(PhysXFoundation.cmake) +INCLUDE(LowLevel.cmake) +INCLUDE(LowLevelAABB.cmake) +INCLUDE(LowLevelDynamics.cmake) +INCLUDE(PhysX.cmake) +INCLUDE(PhysXCharacterKinematic.cmake) +INCLUDE(PhysXCommon.cmake) +INCLUDE(PhysXCooking.cmake) +INCLUDE(PhysXExtensions.cmake) +INCLUDE(PhysXVehicle.cmake) +INCLUDE(PhysXPvdSDK.cmake) +INCLUDE(PhysXTask.cmake) +INCLUDE(SceneQuery.cmake) +INCLUDE(SimulationController.cmake) +INCLUDE(FastXml.cmake) + +# Set folder PhysX SDK to all common SDK source projects +SET_PROPERTY(TARGET PhysX PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXCharacterKinematic PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXCommon PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXCooking PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXExtensions PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXVehicle PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET LowLevel PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET LowLevelAABB PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET LowLevelDynamics PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET SceneQuery PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET SimulationController PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET FastXml PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXPvdSDK PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXTask PROPERTY FOLDER "PhysX SDK") +SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK")