Browse Source

OSX support for the PhysX SDK

rdb 15 years ago
parent
commit
0d12ddf3e9
2 changed files with 15 additions and 22 deletions
  1. 9 5
      makepanda/makepanda.py
  2. 6 17
      panda/src/physx/physx_includes.h

+ 9 - 5
makepanda/makepanda.py

@@ -636,8 +636,12 @@ if (COMPILER=="LINUX"):
         IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
         IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
         LibDirectory("PHYSX", SDK["PHYSXLIBS"])
-        LibName("PHYSX", "-lPhysXLoader")
-        LibName("PHYSX", "-lNxCharacter")
+        if (sys.platform == "darwin"):
+            LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
+            LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
+        else:
+            LibName("PHYSX", "-lPhysXLoader")
+            LibName("PHYSX", "-lNxCharacter")
 
 DefSymbol("ALWAYS", "MAKEPANDA", "")
 DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
@@ -3349,7 +3353,7 @@ if (PkgSkip("ODE")==0 and not RUNTIME):
 #
 
 if (PkgSkip("PHYSX")==0):
-  OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX']
+  OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOPPC']
   TargetAdd('physx_composite.obj', opts=OPTS, input='physx_composite.cxx')
   IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite.cxx"])
   TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
@@ -3361,7 +3365,7 @@ if (PkgSkip("PHYSX")==0):
 #
 
 if (PkgSkip("PHYSX")==0):
-  OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX']
+  OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOPPC']
   TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
 
   TargetAdd('libpandaphysx_module.obj', input='libpandaphysx.in')
@@ -3373,7 +3377,7 @@ if (PkgSkip("PHYSX")==0):
   TargetAdd('libpandaphysx.dll', input='physx_composite.obj')
   TargetAdd('libpandaphysx.dll', input='libpandaphysx_igate.obj')
   TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
-  TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX'])
+  TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOPPC'])
 
 #
 # DIRECTORY: panda/src/physics/

+ 6 - 17
panda/src/physx/physx_includes.h

@@ -17,34 +17,23 @@
 
 
 // Platform-specific defines
-#ifdef WIN32
-#if _WIN64 || __amd64__
-#define NX64 1
-#else
-#define NX32 1
+#if NATIVE_WORDSIZE == 64
+#define NX64
 #endif
+
+#if NATIVE_WORDSIZE == 32
+#define NX32
 #endif
 
 #ifdef IS_LINUX
 #define LINUX 1
-#ifdef _LP64
-#define NX64 1
-#else
-#define NX32 1
-#endif
 #define CORELIB 1
 #define NX_DISABLE_FLUIDS 1
 #define NX_DISABLE_HARDWARE 1
 #endif
 
-#ifdef IS_FREEBSD
-#endif
-
-#ifdef IS_OSX
-#endif
-
 
-// Undefine min and max before ay PhysX headers get included
+// Undefine min and max before any PhysX headers get included
 #undef min
 #undef max