|
| 1 | +## Redistribution and use in source and binary forms, with or without |
| 2 | +## modification, are permitted provided that the following conditions |
| 3 | +## are met: |
| 4 | +## * Redistributions of source code must retain the above copyright |
| 5 | +## notice, this list of conditions and the following disclaimer. |
| 6 | +## * Redistributions in binary form must reproduce the above copyright |
| 7 | +## notice, this list of conditions and the following disclaimer in the |
| 8 | +## documentation and/or other materials provided with the distribution. |
| 9 | +## * Neither the name of NVIDIA CORPORATION nor the names of its |
| 10 | +## contributors may be used to endorse or promote products derived |
| 11 | +## from this software without specific prior written permission. |
| 12 | +## |
| 13 | +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY |
| 14 | +## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | +## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 17 | +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | +## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | +## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | +## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | +## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | +## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | +## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | +## |
| 25 | +## Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved. |
| 26 | + |
| 27 | +IF(PX_OUTPUT_ARCH STREQUAL "arm") |
| 28 | + SET(OSX_BITNESS "-arch arm64") |
| 29 | + SET(CMAKE_OSX_ARCHITECTURES "arm64") |
| 30 | + SET(ARCH_SIMD_FLAG "") # No flags needed to enable NEON |
| 31 | +ELSE() |
| 32 | + SET(OSX_BITNESS "-arch x86_64") |
| 33 | + SET(CMAKE_OSX_ARCHITECTURES "x86_64") |
| 34 | + SET(ARCH_SIMD_FLAG "-msse2") |
| 35 | +ENDIF() |
| 36 | + |
| 37 | +SET(PHYSX_CXX_FLAGS "${OSX_BITNESS} ${ARCH_SIMD_FLAG} -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -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 -Wno-suggest-destructor-override -Wno-suggest-override -Wno-alloca -Wno-switch-enum -Wno-unused-but-set-variable -Wno-shadow-field -gdwarf-2" CACHE INTERNAL "PhysX CXX") |
| 38 | + |
| 39 | +SET(CMAKE_SHARED_LINKER_FLAGS_CHECKED "") |
| 40 | +SET(CMAKE_SHARED_LINKER_FLAGS_PROFILE "") |
| 41 | +SET(CMAKE_SHARED_LINKER_FLAGS "") |
| 42 | + |
| 43 | +# Build debug info for all configurations |
| 44 | +SET(PHYSX_CXX_FLAGS_DEBUG "-O0 -g" CACHE INTERNAL "PhysX Debug CXX Flags") |
| 45 | +SET(PHYSX_CXX_FLAGS_CHECKED "-O3 -g" CACHE INTERNAL "PhysX Checked CXX Flags") |
| 46 | +SET(PHYSX_CXX_FLAGS_PROFILE "-O3 -g" CACHE INTERNAL "PhysX Profile CXX Flags") |
| 47 | +SET(PHYSX_CXX_FLAGS_RELEASE "-O3 -g" CACHE INTERNAL "PhysX Release CXX Flags") |
| 48 | + |
| 49 | +# These flags are local to the directory the CMakeLists.txt is in |
| 50 | +SET(CMAKE_CXX_FLAGS ${PHYSX_CXX_FLAGS}) |
| 51 | + |
| 52 | +SET(CMAKE_CXX_FLAGS_DEBUG ${PHYSX_CXX_FLAGS_DEBUG}) |
| 53 | +SET(CMAKE_CXX_FLAGS_CHECKED ${PHYSX_CXX_FLAGS_CHECKED}) |
| 54 | +SET(CMAKE_CXX_FLAGS_PROFILE ${PHYSX_CXX_FLAGS_PROFILE}) |
| 55 | +SET(CMAKE_CXX_FLAGS_RELEASE ${PHYSX_CXX_FLAGS_RELEASE}) |
| 56 | + |
| 57 | +IF(PUBLIC_RELEASE) |
| 58 | + SET(PUBLIC_RELEASE_FLAG "PX_PUBLIC_RELEASE=1") |
| 59 | +ELSE() |
| 60 | + SET(PUBLIC_RELEASE_FLAG "PX_PUBLIC_RELEASE=0") |
| 61 | +ENDIF() |
| 62 | + |
| 63 | +#set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym") |
| 64 | + |
| 65 | +# Controls PX_NVTX for all projects on Mac |
| 66 | +SET(NVTX_FLAG "PX_NVTX=0") |
| 67 | + |
| 68 | +# Disable OmniPVD for all projects on Mac |
| 69 | +SET(PX_SUPPORT_OMNI_PVD_FLAG "PX_SUPPORT_OMNI_PVD=0") |
| 70 | + |
| 71 | +# Disable cuda for all projects |
| 72 | +SET(PHYSX_MAC_COMPILE_DEFS "DISABLE_CUDA_PHYSX;${PHYSX_AUTOBUILD};${PUBLIC_RELEASE_FLAG};${FEATURES_UNDER_CONSTRUCTION_FLAG}" CACHE INTERNAL "Base PhysX preprocessor definitions") |
| 73 | +SET(PHYSX_MAC_DEBUG_COMPILE_DEFS "_DEBUG;PX_DEBUG=1;PX_CHECKED=1;${NVTX_FLAG};PX_SUPPORT_PVD=1;${PX_SUPPORT_OMNI_PVD_FLAG}" CACHE INTERNAL "Debug PhysX preprocessor definitions") |
| 74 | +SET(PHYSX_MAC_CHECKED_COMPILE_DEFS "NDEBUG;PX_CHECKED=1;${NVTX_FLAG};PX_SUPPORT_PVD=1;${PX_SUPPORT_OMNI_PVD_FLAG}" CACHE INTERNAL "Checked PhysX preprocessor definitions") |
| 75 | +SET(PHYSX_MAC_PROFILE_COMPILE_DEFS "NDEBUG;PX_PROFILE=1;${NVTX_FLAG};PX_SUPPORT_PVD=1;${PX_SUPPORT_OMNI_PVD_FLAG}" CACHE INTERNAL "Profile PhysX preprocessor definitions") |
| 76 | +SET(PHYSX_MAC_RELEASE_COMPILE_DEFS "NDEBUG;PX_SUPPORT_PVD=0;PX_SUPPORT_OMNI_PVD=0" CACHE INTERNAL "Release PhysX preprocessor definitions") |
| 77 | + |
| 78 | + |
| 79 | +# Include all of the projects |
| 80 | +INCLUDE(PhysXFoundation.cmake) |
| 81 | +INCLUDE(LowLevel.cmake) |
| 82 | +INCLUDE(LowLevelAABB.cmake) |
| 83 | +INCLUDE(LowLevelDynamics.cmake) |
| 84 | +INCLUDE(PhysX.cmake) |
| 85 | +INCLUDE(PhysXCharacterKinematic.cmake) |
| 86 | +INCLUDE(PhysXCommon.cmake) |
| 87 | +INCLUDE(PhysXCooking.cmake) |
| 88 | +INCLUDE(PhysXExtensions.cmake) |
| 89 | +INCLUDE(PhysXVehicle.cmake) |
| 90 | +INCLUDE(PhysXVehicle2.cmake) |
| 91 | +INCLUDE(PhysXPvdSDK.cmake) |
| 92 | +INCLUDE(PhysXTask.cmake) |
| 93 | +INCLUDE(SceneQuery.cmake) |
| 94 | +INCLUDE(SimulationController.cmake) |
| 95 | +INCLUDE(FastXml.cmake) |
| 96 | + |
| 97 | +# Set folder PhysX SDK to all common SDK source projects |
| 98 | +SET_PROPERTY(TARGET PhysX PROPERTY FOLDER "PhysX SDK") |
| 99 | +SET_PROPERTY(TARGET PhysXCharacterKinematic PROPERTY FOLDER "PhysX SDK") |
| 100 | +SET_PROPERTY(TARGET PhysXCommon PROPERTY FOLDER "PhysX SDK") |
| 101 | +SET_PROPERTY(TARGET PhysXCooking PROPERTY FOLDER "PhysX SDK") |
| 102 | +SET_PROPERTY(TARGET PhysXExtensions PROPERTY FOLDER "PhysX SDK") |
| 103 | +SET_PROPERTY(TARGET PhysXVehicle PROPERTY FOLDER "PhysX SDK") |
| 104 | +SET_PROPERTY(TARGET PhysXVehicle2 PROPERTY FOLDER "PhysX SDK") |
| 105 | +SET_PROPERTY(TARGET LowLevel PROPERTY FOLDER "PhysX SDK") |
| 106 | +SET_PROPERTY(TARGET LowLevelAABB PROPERTY FOLDER "PhysX SDK") |
| 107 | +SET_PROPERTY(TARGET LowLevelDynamics PROPERTY FOLDER "PhysX SDK") |
| 108 | +SET_PROPERTY(TARGET SceneQuery PROPERTY FOLDER "PhysX SDK") |
| 109 | +SET_PROPERTY(TARGET SimulationController PROPERTY FOLDER "PhysX SDK") |
| 110 | +SET_PROPERTY(TARGET FastXml PROPERTY FOLDER "PhysX SDK") |
| 111 | +SET_PROPERTY(TARGET PhysXPvdSDK PROPERTY FOLDER "PhysX SDK") |
| 112 | +SET_PROPERTY(TARGET PhysXTask PROPERTY FOLDER "PhysX SDK") |
| 113 | +SET_PROPERTY(TARGET PhysXFoundation PROPERTY FOLDER "PhysX SDK") |
0 commit comments