Update PhysX with new slim Build

Rebuild for win64 and android only
This commit is contained in:
Wojtek Figat
2026-03-26 09:33:56 +01:00
parent f92ec30e1b
commit 0f09cad1cf
39 changed files with 87 additions and 73 deletions

View File

@@ -35,6 +35,8 @@
#include "common/PxBase.h"
#include "extensions/PxRepXSimpleType.h"
#if PX_SERIALIZATION
#if !PX_DOXYGEN
namespace physx
{
@@ -147,3 +149,4 @@ PX_INLINE physx::PxRepXObject PxCreateRepXObject(const TDataType* inType)
/** @} */
#endif
#endif

View File

@@ -86,7 +86,7 @@ PX_FORCE_INLINE uint32_t PxComputeHash(const uint64_t key)
return uint32_t(UINT32_MAX & k);
}
#if PX_APPLE_FAMILY
#if PX_APPLE_FAMILY || PX_EMSCRIPTEN
// hash for size_t, to make gcc happy
PX_INLINE uint32_t PxComputeHash(const size_t key)
{

View File

@@ -45,7 +45,7 @@
#pragma warning(pop)
#endif
#if (PX_LINUX_FAMILY && !PX_ARM_FAMILY)
#if (PX_LINUX_FAMILY && !PX_ARM_FAMILY && !PX_EMSCRIPTEN)
// Force linking against nothing newer than glibc v2.17 to remain compatible with platforms with older glibc versions
__asm__(".symver expf,expf@GLIBC_2.2.5");
__asm__(".symver powf,powf@GLIBC_2.2.5");

View File

@@ -437,8 +437,16 @@ Use these macro definitions to create warnings for deprecated functions
General defines
*/
// Customization to exclude serialization code
#define PX_SERIALIZATION 0
// Customization to exclude soft-bodies (incl. tetrahedral meshes)
#define PX_SOFT_BODY 0
// static assert
#if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_APPLE_FAMILY) || (PX_SWITCH || PX_PS4 || PX_PS5) || (PX_CLANG && PX_ARM) || (PX_CLANG && PX_A64)
#if PX_EMSCRIPTEN
#define PX_COMPILE_TIME_ASSERT(exp)
#elif(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_APPLE_FAMILY) || (PX_SWITCH || PX_PS4 || PX_PS5) || (PX_CLANG && PX_ARM) || (PX_CLANG && PX_A64)
#define PX_COMPILE_TIME_ASSERT(exp) typedef char PX_CONCAT(PxCompileTimeAssert_Dummy, __COUNTER__)[(exp) ? 1 : -1] __attribute__((unused))
#else
#define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1]

View File

@@ -48,6 +48,7 @@ namespace Flax.Deps.Dependencies
throw new Exception(string.Format("Missing PhysX preset {0} (file: {1})", preset, presetPath));
var presetXml = new XmlDocument();
presetXml.Load(presetPath);
var usePVD = false;
// Configure preset
var cmakeSwitches = presetXml["preset"]["CMakeSwitches"];
@@ -59,6 +60,11 @@ namespace Flax.Deps.Dependencies
ConfigureCmakeSwitch(cmakeSwitches, "NV_USE_STATIC_WINCRT", "False");
ConfigureCmakeSwitch(cmakeSwitches, "NV_USE_DEBUG_WINCRT", "False");
ConfigureCmakeSwitch(cmakeSwitches, "PX_FLOAT_POINT_PRECISE_MATH", "False");
if (usePVD)
{
// PVD depends on metadata and serialization code striped from shipping builds
ConfigureCmakeSwitch(cmakeSwitches, "PX_SERIALIZATION", "True");
}
var cmakeParams = presetXml["preset"]["CMakeParams"];
switch (targetPlatform)
{
@@ -286,12 +292,18 @@ namespace Flax.Deps.Dependencies
Log.Verbose("Copy PhysX binaries from " + srcBinaries);
foreach (var physXLib in defaultPhysXLibs)
{
var remove = !usePVD && physXLib.Contains("Pvd");
var filename = suppressBitsPostfix ? string.Format("{0}{1}_static", binariesPrefix, physXLib) : string.Format("{0}{1}_static_{2}", binariesPrefix, physXLib, bits);
filename += binariesExtension;
Utilities.FileCopy(Path.Combine(srcBinaries, filename), Path.Combine(dstBinaries, filename));
if (remove)
Utilities.FileDelete(Path.Combine(dstBinaries, filename));
else
Utilities.FileCopy(Path.Combine(srcBinaries, filename), Path.Combine(dstBinaries, filename));
var filenamePdb = Path.ChangeExtension(filename, "pdb");
if (File.Exists(Path.Combine(srcBinaries, filenamePdb)))
if (remove)
Utilities.FileDelete(Path.Combine(dstBinaries, filenamePdb));
else if (File.Exists(Path.Combine(srcBinaries, filenamePdb)))
Utilities.FileCopy(Path.Combine(srcBinaries, filenamePdb), Path.Combine(dstBinaries, filenamePdb));
// Strip debug symbols to reduce binaries size