Browse Source

USE_DEBUG_PYTHON

David Rose 20 years ago
parent
commit
20b5398ab8
4 changed files with 8 additions and 3 deletions
  1. 2 2
      direct/src/ffi/genPyCode.pp
  2. 4 0
      dtool/Config.pp
  3. 1 0
      dtool/LocalSetup.pp
  4. 1 1
      dtool/src/interrogatedb/py_panda.h

+ 2 - 2
direct/src/ffi/genPyCode.pp

@@ -14,7 +14,7 @@
 #define install_igatedb_dir $[or $[INSTALL_IGATEDB_DIR],$[install_dir]/etc]
 
 #define python $[PYTHON_COMMAND]
-#if $[< $[OPTIMIZE],3]
+#if $[USE_DEBUG_PYTHON]
   #define python $[PYTHON_DEBUG_COMMAND]
 #endif
 
@@ -58,7 +58,7 @@ $[python] -u '$[osfilename $[install_bin_dir]/genPyCode.py]' "$@"
 #endif  // Win32
 
 #output genPyCode.py
-#! /usr/bin/env python
+#! /usr/bin/env $[python]
 #### Generated automatically by $[PPREMAKE] $[PPREMAKE_VERSION] from $[notdir $[THISFILENAME]].
 ################################# DO NOT EDIT ###########################
 

+ 4 - 0
dtool/Config.pp

@@ -269,6 +269,10 @@
 #define PYTHON_FRAMEWORK
 #defer HAVE_PYTHON $[isdir $[PYTHON_IPATH]]
 
+// By default, we'll assume the user only wants to run with Debug
+// python if he has to--that is, on Windows when building a debug build.
+#defer USE_DEBUG_PYTHON $[and $[< $[OPTIMIZE],3],$[WINDOWS_PLATFORM]]
+
 // Define the default set of libraries to be instrumented by
 // genPyCode.  You may wish to add to this list to add your own
 // libraries, or if you want to use some of the more obscure

+ 1 - 0
dtool/LocalSetup.pp

@@ -118,6 +118,7 @@
 
 /* Define if we have Python installed.  */
 $[cdefine HAVE_PYTHON]
+$[cdefine USE_DEBUG_PYTHON]
 /* Define if we have Python as a framework (Mac OS X).  */
 $[cdefine PYTHON_FRAMEWORK]
 

+ 1 - 1
dtool/src/interrogatedb/py_panda.h

@@ -32,7 +32,7 @@
 #include <map>
 #include <string>
 
-#ifdef _DEBUG
+#ifdef USE_DEBUG_PYTHON
 #define  Py_DEBUG
 #endif