[physx] Add patch for NVIDIAGameWorks/PhysX#322. (#12413)

* [physx] Add patch for NVIDIAGameWorks/PhysX#322.

* [physx] Cleanup usage of `VCPKG_CMAKE_SYSTEM_NAME`.

* [physx] Convert portfile space indentation to tabs.

* Update portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
This commit is contained in:
Adam Johnson 2020-07-31 14:27:31 -04:00 committed by GitHub
parent 62d4320409
commit 092267fd50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 68 additions and 19 deletions

View File

@ -1,4 +1,5 @@
Source: physx
Version: 4.1.1-3
Version: 4.1.1
Port-Version: 4
Description: The NVIDIA PhysX SDK is a scalable multi-platform physics solution supporting a wide range of devices, from smartphones to high-end multicore CPUs and GPUs
Supports: !uwp

View File

@ -0,0 +1,49 @@
diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp
index f19ba271..51580049 100644
--- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp
+++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.cpp
@@ -90,6 +90,8 @@ using namespace Cm;
return ir;
}*/
+namespace internalMBP {
+
struct RegionHandle : public Ps::UserAllocated
{
PxU16 mHandle; // Handle from region
@@ -582,6 +584,10 @@ struct RegionData : public Ps::UserAllocated
#endif
#endif
+}
+
+using namespace internalMBP;
+
///////////////////////////////////////////////////////////////////////////////
MBP_PairManager::MBP_PairManager() :
diff --git a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h
index cf15f6d3..90f43e47 100644
--- a/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h
+++ b/physx/source/lowlevelaabb/src/BpBroadPhaseMBP.h
@@ -35,8 +35,10 @@
#include "BpBroadPhaseMBPCommon.h"
#include "BpMBPTasks.h"
+namespace internalMBP {
class MBP;
-
+}
+
namespace physx
{
namespace Bp
@@ -84,7 +86,7 @@ namespace Bp
MBPUpdateWorkTask mMBPUpdateWorkTask;
MBPPostUpdateWorkTask mMBPPostUpdateWorkTask;
- MBP* mMBP; // PT: TODO: aggregate
+ internalMBP::MBP* mMBP; // PT: TODO: aggregate
MBP_Handle* mMapping;
PxU32 mCapacity;

View File

@ -1,5 +1,3 @@
include(vcpkg_common_functions)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(SYSTEM_PLATFORM "32")
set(SYSTEM_PLATFORM_PATH "x86_32")
@ -13,30 +11,30 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(SYSTEM_PLATFORM "arm64")
set(SYSTEM_PLATFORM_PATH "arm_64")
else()
message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(GENERATE_STATIC_LIBRARIES "True")
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(GENERATE_STATIC_LIBRARIES "False")
set(GENERATE_STATIC_LIBRARIES "False")
endif()
if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(MSBUILD_PLATFORM "Win32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(MSBUILD_PLATFORM "x64")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
elseif(VCPKG_TARGET_IS_UWP)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(MSBUILD_PLATFORM "ARM")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(MSBUILD_PLATFORM "ARM64")
else()
message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}")
message(FATAL_ERROR "Unsupported UWP architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
else()
message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}")
message(FATAL_ERROR "Unsupported Windows architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
if(VCPKG_PLATFORM_TOOLSET STREQUAL "v140")
@ -56,7 +54,7 @@ if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL
set(BUILD_SNIPPETS "False")
set(BUILD_PUBLIC_SAMPLES "False")
if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "")
if(VCPKG_TARGET_IS_WINDOWS)
set(SYSTEM "win")
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(USE_STATIC_WINCRT "False")
@ -69,7 +67,7 @@ if("${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL
set(COMPILER "vc${MSVC_VERSION}${SYSTEM}${SYSTEM_PLATFORM}")
set(PRESET_FILE ${COMPILER}-${RUNTIME_LIBRARY_LINKAGE}-${VCPKG_LIBRARY_LINKAGE})
set(BUILD_PATH "${SYSTEM}.${SYSTEM_PLATFORM_PATH}.vc${TOOLSET_VERSION}.${RUNTIME_LIBRARY_LINKAGE}")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
elseif(VCPKG_TARGET_IS_UWP)
set(SYSTEM "uwp")
set(USE_STATIC_WINCRT "False")
set(USE_DEBUG_CRT "False")
@ -87,9 +85,10 @@ vcpkg_from_github(
REF ae80dede0546d652040ae6260a810e53e20a06fa
SHA512 f3a690039cf39fe2db9a728b82af0d39eaa02340a853bdad4b5152d63532367eb24fc7033a614882168049b80d803b6225fc60ed2900a9d0deab847f220540be
HEAD_REF master
PATCHES
msvc_142_bug_workaround.patch
vs16_3_typeinfo_header_fix.patch
PATCHES
internalMBP_symbols.patch
msvc_142_bug_workaround.patch
vs16_3_typeinfo_header_fix.patch
)
file(REMOVE ${SOURCE_PATH}/physx/buildtools/presets/public/${PRESET_FILE}.xml)
@ -114,10 +113,10 @@ set(RELEASE_CONFIGURATION "release")
set(DEBUG_CONFIGURATION "debug")
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln
PROJECT_PATH ${SOURCE_PATH}/physx/compiler/${COMPILER}/PhysXSDK.sln
RELEASE_CONFIGURATION ${RELEASE_CONFIGURATION}
DEBUG_CONFIGURATION ${DEBUG_CONFIGURATION}
PLATFORM ${MSBUILD_PLATFORM}
PLATFORM ${MSBUILD_PLATFORM}
)
file(INSTALL ${SOURCE_PATH}/physx/include/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/${PORT}/)
@ -136,9 +135,9 @@ endif()
file(
GLOB
RELEASE_LIBS
${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib
${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb
${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb
${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.lib
${SOURCE_PATH}/physx/bin/${BUILD_PATH}/${RELEASE_CONFIGURATION}/*.pdb
${SOURCE_PATH}/physx/compiler/${COMPILER}/sdk_source_bin/${RELEASE_CONFIGURATION}/*.pdb
)
file(INSTALL ${RELEASE_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)