diff --git a/panda/src/gobj/texture_ext.cxx b/panda/src/gobj/texture_ext.cxx index 2a462849c0..1e661e960a 100644 --- a/panda/src/gobj/texture_ext.cxx +++ b/panda/src/gobj/texture_ext.cxx @@ -13,6 +13,8 @@ #include "texture_ext.h" +#ifdef HAVE_PYTHON + #ifndef CPPPARSER extern Dtool_PyTypedObject Dtool_PointerToArray_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"); } + +#endif // HAVE_PYTHON diff --git a/panda/src/gobj/texture_ext.h b/panda/src/gobj/texture_ext.h index f5b4bb4ccd..d33fce24ef 100644 --- a/panda/src/gobj/texture_ext.h +++ b/panda/src/gobj/texture_ext.h @@ -20,6 +20,8 @@ #include "py_panda.h" #include "texture.h" +#ifdef HAVE_PYTHON + /** * This class defines the extension methods for Texture, which are * 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); }; +#endif // HAVE_PYTHON + #endif // CPPPARSER #endif // TEXTURE_EXT_H