Skip to content

Commit 65f4724

Browse files
committed
Merge branch 'main' into Physics_Suvrat
2 parents 5412cb0 + 09b80aa commit 65f4724

4 files changed

Lines changed: 43 additions & 19 deletions

File tree

CMakePresets.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@
99
{
1010
"name": "Debug",
1111
"configuration": "Debug",
12-
"configurePreset": "VS2019 Debug",
12+
"configurePreset": "VS2019",
13+
"targets": ["game"]
14+
},
15+
{
16+
"name": "Release",
17+
"configuration": "Release",
18+
"configurePreset": "VS2019",
1319
"targets": ["game"]
1420
}
1521
],
1622
"configurePresets": [
1723
{
18-
"name": "VS2019 Debug",
24+
"name": "VS2019",
1925
"generator": "Visual Studio 16 2019",
2026
"architecture": "x64",
2127
"binaryDir": "build",

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ start setup_physx.bat
2929
3. Setup CMake
3030

3131
3a. Command line
32-
Either open the root repo folder in VSCode and select the "VS2019 Debug" preset, or run
32+
Either open the root repo folder in VSCode and select the "VS2019" preset, or run
3333
```
3434
# Run in the repo root
35-
cmake --preset "VS2019 Debug"
35+
cmake --preset "VS2019"
3636
```
3737

3838
3b. VSCode

setup_physx.bat

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
@echo off
2+
3+
: Determine config type to use for PhysX
4+
set CONFIG=%~1
5+
if "%CONFIG%"=="" set CONFIG=debug
6+
echo Setting up PhysX for config: %CONFIG%
7+
18
: Set up and build PhysX
29
cd thirdparty\physx\physx
310
call generate_projects.bat vc16win64
411

512
: NV_USE_STATIC_WINCRT needs to be set to 'False' due to the Extensions lib always being built statically
613
cmake -B compiler/vc16win64 -S compiler/public -DNV_USE_STATIC_WINCRT=False
714

8-
cmake --build compiler/vc16win64 --config=debug
9-
cmake --install compiler/vc16win64 --config=debug --prefix="%~dp0/thirdparty/physx-build"
15+
cmake --build compiler/vc16win64 --config=%CONFIG%
16+
cmake --install compiler/vc16win64 --config=%CONFIG% --prefix="%~dp0/thirdparty/physx-build"

thirdparty/physx.cmake

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
set(PHYSX_CONFIG debug)
2-
3-
set(PHYSX_INSTALL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/physx-build)
4-
set(PHYSX_INSTALL_BIN ${PHYSX_INSTALL_ROOT}/bin/win.x86_64.vc142.md/${PHYSX_CONFIG})
1+
set(PHYSX_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/physx-build)
2+
set(PHYSX_BIN ${PHYSX_ROOT}/bin/win.x86_64.vc142.md)
53

64
# ---------------------------
75
# Individual PhysX components
@@ -10,34 +8,47 @@ set(PHYSX_INSTALL_BIN ${PHYSX_INSTALL_ROOT}/bin/win.x86_64.vc142.md/${PHYSX_CONF
108
add_library(PhysX::PhysX64 SHARED IMPORTED GLOBAL)
119
set_target_properties(PhysX::PhysX64
1210
PROPERTIES
13-
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysX_64.dll
14-
IMPORTED_IMPLIB ${PHYSX_INSTALL_BIN}/PhysX_64.lib
11+
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysX_64.dll
12+
IMPORTED_IMPLIB_DEBUG ${PHYSX_BIN}/debug/PhysX_64.lib
13+
14+
IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysX_64.dll
15+
IMPORTED_IMPLIB_RELEASE ${PHYSX_BIN}/release/PhysX_64.lib
1516
)
1617

1718
add_library(PhysX::PhysXCommon64 SHARED IMPORTED GLOBAL)
1819
set_target_properties(PhysX::PhysXCommon64
1920
PROPERTIES
20-
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXCommon_64.dll
21-
IMPORTED_IMPLIB ${PHYSX_INSTALL_BIN}/PhysXCommon_64.lib
21+
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXCommon_64.dll
22+
IMPORTED_IMPLIB_DEBUG ${PHYSX_BIN}/debug/PhysXCommon_64.lib
23+
24+
IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXCommon_64.dll
25+
IMPORTED_IMPLIB_RELEASE ${PHYSX_BIN}/release/PhysXCommon_64.lib
2226
)
2327

2428
add_library(PhysX::PhysXFoundation64 SHARED IMPORTED GLOBAL)
2529
set_target_properties(PhysX::PhysXFoundation64
2630
PROPERTIES
27-
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXFoundation_64.dll
28-
IMPORTED_IMPLIB ${PHYSX_INSTALL_BIN}/PhysXFoundation_64.lib
31+
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXFoundation_64.dll
32+
IMPORTED_IMPLIB_DEBUG ${PHYSX_BIN}/debug/PhysXFoundation_64.lib
33+
34+
IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXFoundation_64.dll
35+
IMPORTED_IMPLIB_RELEASE ${PHYSX_BIN}/release/PhysXFoundation_64.lib
2936
)
3037

3138
add_library(PhysX::PhysXPvdSDKStatic64 STATIC IMPORTED GLOBAL)
3239
set_target_properties(PhysX::PhysXPvdSDKStatic64
3340
PROPERTIES
34-
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXPvdSDK_static_64.lib
41+
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXPvdSDK_static_64.lib
42+
43+
IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXPvdSDK_static_64.lib
3544
)
3645

3746
add_library(PhysX::PhysXExtensions64 STATIC IMPORTED GLOBAL)
3847
set_target_properties(PhysX::PhysXExtensions64
3948
PROPERTIES
40-
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXExtensions_static_64.lib
49+
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXExtensions_static_64.lib
50+
51+
IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXExtensions_static_64.lib
4152
)
4253

4354

@@ -53,5 +64,5 @@ set_target_properties(PhysX::PhysX
5364
)
5465
target_include_directories(PhysX::PhysX
5566
INTERFACE
56-
${PHYSX_INSTALL_ROOT}/include
67+
${PHYSX_ROOT}/include
5768
)

0 commit comments

Comments
 (0)