Skip to content

Commit

Permalink
Merge branch 'main' into Physics_Suvrat
Browse files Browse the repository at this point in the history
  • Loading branch information
raduschirliu committed Jan 23, 2023
2 parents 5412cb0 + 09b80aa commit 65f4724
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
10 changes: 8 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@
{
"name": "Debug",
"configuration": "Debug",
"configurePreset": "VS2019 Debug",
"configurePreset": "VS2019",
"targets": ["game"]
},
{
"name": "Release",
"configuration": "Release",
"configurePreset": "VS2019",
"targets": ["game"]
}
],
"configurePresets": [
{
"name": "VS2019 Debug",
"name": "VS2019",
"generator": "Visual Studio 16 2019",
"architecture": "x64",
"binaryDir": "build",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ start setup_physx.bat
3. Setup CMake

3a. Command line
Either open the root repo folder in VSCode and select the "VS2019 Debug" preset, or run
Either open the root repo folder in VSCode and select the "VS2019" preset, or run
```
# Run in the repo root
cmake --preset "VS2019 Debug"
cmake --preset "VS2019"
```

3b. VSCode
Expand Down
11 changes: 9 additions & 2 deletions setup_physx.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
@echo off

: Determine config type to use for PhysX
set CONFIG=%~1
if "%CONFIG%"=="" set CONFIG=debug
echo Setting up PhysX for config: %CONFIG%

: Set up and build PhysX
cd thirdparty\physx\physx
call generate_projects.bat vc16win64

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

cmake --build compiler/vc16win64 --config=debug
cmake --install compiler/vc16win64 --config=debug --prefix="%~dp0/thirdparty/physx-build"
cmake --build compiler/vc16win64 --config=%CONFIG%
cmake --install compiler/vc16win64 --config=%CONFIG% --prefix="%~dp0/thirdparty/physx-build"
37 changes: 24 additions & 13 deletions thirdparty/physx.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
set(PHYSX_CONFIG debug)

set(PHYSX_INSTALL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/physx-build)
set(PHYSX_INSTALL_BIN ${PHYSX_INSTALL_ROOT}/bin/win.x86_64.vc142.md/${PHYSX_CONFIG})
set(PHYSX_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/physx-build)
set(PHYSX_BIN ${PHYSX_ROOT}/bin/win.x86_64.vc142.md)

# ---------------------------
# Individual PhysX components
Expand All @@ -10,34 +8,47 @@ set(PHYSX_INSTALL_BIN ${PHYSX_INSTALL_ROOT}/bin/win.x86_64.vc142.md/${PHYSX_CONF
add_library(PhysX::PhysX64 SHARED IMPORTED GLOBAL)
set_target_properties(PhysX::PhysX64
PROPERTIES
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysX_64.dll
IMPORTED_IMPLIB ${PHYSX_INSTALL_BIN}/PhysX_64.lib
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysX_64.dll
IMPORTED_IMPLIB_DEBUG ${PHYSX_BIN}/debug/PhysX_64.lib

IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysX_64.dll
IMPORTED_IMPLIB_RELEASE ${PHYSX_BIN}/release/PhysX_64.lib
)

add_library(PhysX::PhysXCommon64 SHARED IMPORTED GLOBAL)
set_target_properties(PhysX::PhysXCommon64
PROPERTIES
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXCommon_64.dll
IMPORTED_IMPLIB ${PHYSX_INSTALL_BIN}/PhysXCommon_64.lib
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXCommon_64.dll
IMPORTED_IMPLIB_DEBUG ${PHYSX_BIN}/debug/PhysXCommon_64.lib

IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXCommon_64.dll
IMPORTED_IMPLIB_RELEASE ${PHYSX_BIN}/release/PhysXCommon_64.lib
)

add_library(PhysX::PhysXFoundation64 SHARED IMPORTED GLOBAL)
set_target_properties(PhysX::PhysXFoundation64
PROPERTIES
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXFoundation_64.dll
IMPORTED_IMPLIB ${PHYSX_INSTALL_BIN}/PhysXFoundation_64.lib
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXFoundation_64.dll
IMPORTED_IMPLIB_DEBUG ${PHYSX_BIN}/debug/PhysXFoundation_64.lib

IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXFoundation_64.dll
IMPORTED_IMPLIB_RELEASE ${PHYSX_BIN}/release/PhysXFoundation_64.lib
)

add_library(PhysX::PhysXPvdSDKStatic64 STATIC IMPORTED GLOBAL)
set_target_properties(PhysX::PhysXPvdSDKStatic64
PROPERTIES
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXPvdSDK_static_64.lib
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXPvdSDK_static_64.lib

IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXPvdSDK_static_64.lib
)

add_library(PhysX::PhysXExtensions64 STATIC IMPORTED GLOBAL)
set_target_properties(PhysX::PhysXExtensions64
PROPERTIES
IMPORTED_LOCATION ${PHYSX_INSTALL_BIN}/PhysXExtensions_static_64.lib
IMPORTED_LOCATION_DEBUG ${PHYSX_BIN}/debug/PhysXExtensions_static_64.lib

IMPORTED_LOCATION_RELEASE ${PHYSX_BIN}/release/PhysXExtensions_static_64.lib
)


Expand All @@ -53,5 +64,5 @@ set_target_properties(PhysX::PhysX
)
target_include_directories(PhysX::PhysX
INTERFACE
${PHYSX_INSTALL_ROOT}/include
${PHYSX_ROOT}/include
)

0 comments on commit 65f4724

Please sign in to comment.