add PhysX SDK and some tweaks

This commit is contained in:
2025-12-17 12:39:20 +08:00
parent 57ca6c30f5
commit 00d3993a77
26 changed files with 1594 additions and 132 deletions

View File

@ -45,6 +45,36 @@ file(GLOB IMGUIZMO_SOURCE ${IMGUIZMO_DIR}/*.cpp)
list(APPEND SRC_SOURCE ${IMGUIZMO_SOURCE})
# ------------- NVIDIA PhysX -------------
# PhysX/physx/buildtools/presets/*.xml
# PX_GENERATE_STATIC_LIBRARIES=True
# NV_USE_STATIC_WINCRT=False
set(PHYSX_BUILD_TYPE "checked" CACHE STRING "The build type of PhysX")
set_property(CACHE PHYSX_BUILD_TYPE PROPERTY STRINGS debug checked profile release)
if(NOT CMAKE_BUILD_TYPE)
if(PHYSX_BUILD_TYPE STREQUAL "debug" OR PHYSX_BUILD_TYPE STREQUAL "checked")
set(CMAKE_BUILD_TYPE "Debug")
endif()
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(PHYSX_BUILD_TYPE "release")
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PHYSX_BUILD_TYPE "debug")
endif ()
include_directories(vendor/PhysX/physx/include)
link_directories("vendor/PhysX/physx/bin/win.x86_64.vc143.md/${PHYSX_BUILD_TYPE}") # This is the path where PhysX libraries are installed
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Building snippet in debug with PhysX ${PHYSX_BUILD_TYPE} configuration")
add_compile_definitions(_DEBUG)
else()
message("Building snippet in release configuration with PhysX ${PHYSX_BUILD_TYPE} configuration")
add_compile_definitions(NDEBUG)
endif()
# ------------- link libraries -------------
set(LINK_LIBRARIES_PRIVATE
@ -55,6 +85,13 @@ set(LINK_LIBRARIES_PRIVATE
tinyFileDialogs
FastNoise
yaml-cpp
PhysXExtensions_static_64
PhysX_static_64
PhysXPvdSDK_static_64
PhysXCommon_static_64
PhysXFoundation_static_64
PhysXCooking_static_64
)
set(LINK_LIBRARIES_PUBLIC
@ -84,10 +121,11 @@ set(TARGET_INCLUDE_DIR
# ------------- debug Defines -------------
set(DEBUG_DEFINITIONS
$<$<CONFIG:Debug>:PM_ENABLE_ASSERTS>
$<$<CONFIG:RelWithDebInfo>:PM_ENABLE_ASSERTS>
)
# static library
# static library
set(STATIC_LIBRARY ${PROJECT_NAME}-static)
add_library(${STATIC_LIBRARY} STATIC ${SRC_SOURCE})