Browse Source

Fix build without Python

rdb 9 years ago
parent
commit
ed761f2997
2 changed files with 8 additions and 0 deletions
  1. 4 0
      panda/src/gobj/texture_ext.cxx
  2. 4 0
      panda/src/gobj/texture_ext.h

+ 4 - 0
panda/src/gobj/texture_ext.cxx

@@ -13,6 +13,8 @@
 
 
 #include "texture_ext.h"
 #include "texture_ext.h"
 
 
+#ifdef HAVE_PYTHON
+
 #ifndef CPPPARSER
 #ifndef CPPPARSER
 extern Dtool_PyTypedObject Dtool_PointerToArray_unsigned_char;
 extern Dtool_PyTypedObject Dtool_PointerToArray_unsigned_char;
 extern Dtool_PyTypedObject Dtool_ConstPointerToArray_unsigned_char;
 extern Dtool_PyTypedObject Dtool_ConstPointerToArray_unsigned_char;
@@ -145,3 +147,5 @@ set_ram_image_as(PyObject *image, const string &provided_format) {
 
 
   Dtool_Raise_ArgTypeError(image, 0, "Texture.set_ram_image_as", "CPTA_uchar or buffer");
   Dtool_Raise_ArgTypeError(image, 0, "Texture.set_ram_image_as", "CPTA_uchar or buffer");
 }
 }
+
+#endif  // HAVE_PYTHON

+ 4 - 0
panda/src/gobj/texture_ext.h

@@ -20,6 +20,8 @@
 #include "py_panda.h"
 #include "py_panda.h"
 #include "texture.h"
 #include "texture.h"
 
 
+#ifdef HAVE_PYTHON
+
 /**
 /**
  * This class defines the extension methods for Texture, which are
  * This class defines the extension methods for Texture, which are
  * called instead of any C++ methods with the same prototype.
  * called instead of any C++ methods with the same prototype.
@@ -32,6 +34,8 @@ public:
   void set_ram_image_as(PyObject *image, const string &provided_format);
   void set_ram_image_as(PyObject *image, const string &provided_format);
 };
 };
 
 
+#endif  // HAVE_PYTHON
+
 #endif  // CPPPARSER
 #endif  // CPPPARSER
 
 
 #endif  // TEXTURE_EXT_H
 #endif  // TEXTURE_EXT_H