Fix for building without Python
authorCampbell Barton <ideasman42@gmail.com>
Sat, 13 Jun 2015 18:52:52 +0000 (04:52 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 13 Jun 2015 18:53:10 +0000 (04:53 +1000)
source/gameengine/Expressions/CMakeLists.txt
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_MouseActuator.cpp
source/gameengine/Ketsji/KX_MouseActuator.h
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_Scene.cpp

index 48c10d75a17e211a2e8914bcaa82f97af99c8b74..f827a9528b4de9e23cb79bf71dfb60bbf98f456a 100644 (file)
@@ -55,7 +55,6 @@ set(SRC
        StringValue.cpp
        Value.cpp
        VectorValue.cpp
-       KX_PythonCallBack.cpp
 
        BoolValue.h
        ConstExpr.h
@@ -78,7 +77,14 @@ set(SRC
        Value.h
        VectorValue.h
        VoidValue.h
-       KX_PythonCallBack.h
 )
 
+if(WITH_PYTHON)
+       list(APPEND SRC
+               KX_PythonCallBack.cpp
+
+               KX_PythonCallBack.h
+       )
+endif()
+
 blender_add_lib(ge_logic_expressions "${SRC}" "${INC}" "${INC_SYS}")
index e77960b99b16801c975c8109df9f54c9d3ea4211..34d50e2474169c766be2be1a038afbfea18ad375 100644 (file)
 #include "BL_ActionManager.h"
 #include "BL_Action.h"
 
-#include "KX_PythonCallBack.h"
 #include "PyObjectPlus.h" /* python stuff */
 #include "BLI_utildefines.h"
-#include "python_utildefines.h"
+
+#ifdef WITH_PYTHON
+#  include "KX_PythonCallBack.h"
+#  include "python_utildefines.h"
+#endif
 
 // This file defines relationships between parents and children
 // in the game engine.
index c372e6e9ce2fac52b7b9da605aca43ba18a59539..154ad1da3a1387513a215de587f76c0d8cb8d2c1 100644 (file)
@@ -337,7 +337,7 @@ void KX_MouseActuator::setMousePosition(float fx, float fy)
        m_canvas->SetMousePosition(x, y);
 }
 
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* Python functions                                                          */
@@ -536,4 +536,4 @@ PyObject* KX_MouseActuator::PyReset()
        Py_RETURN_NONE;
 }
 
-#endif
+#endif  /* WITH_PYTHON */
index bf90bd21dac0a7a6dfbffd45a0838425dba259f9..e244e27142809fb819b4358aee6de78e57e980ba 100644 (file)
@@ -104,6 +104,9 @@ public:
        virtual void getMousePosition(float*);
        virtual void setMousePosition(float, float);
 
+
+#ifdef WITH_PYTHON
+
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
@@ -122,6 +125,8 @@ public:
 
        static PyObject*        pyattr_get_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
+#endif  /* WITH_PYTHON */
+
 };
 
 #endif //__KX_MOUSEACTUATOR_DOC
index c2c83266791fa393cc714b9fdd4d91394f3c04c5..c3c693ed55fbd36585ce165aa7cffe6c27b836a7 100644 (file)
@@ -36,6 +36,8 @@
 #  pragma warning(disable:4786)
 #endif
 
+#include <stdio.h>
+
 #include "MT_Point3.h"
 #include "RAS_FramingManager.h"
 #include "RAS_ICanvas.h"
index 25755f7127bdce682a4d4dd3fc66df616690e839..2adc20b0288c3d553317d258c4e7f890d917ebae 100644 (file)
@@ -35,6 +35,8 @@
 #  pragma warning (disable:4786)
 #endif
 
+#include <stdio.h>
+
 #include "KX_Scene.h"
 #include "KX_PythonInit.h"
 #include "MT_assert.h"
@@ -43,7 +45,6 @@
 #include "KX_FontObject.h"
 #include "RAS_IPolygonMaterial.h"
 #include "ListValue.h"
-#include "KX_PythonCallBack.h"
 #include "SCA_LogicManager.h"
 #include "SCA_TimeEventManager.h"
 //#include "SCA_AlwaysEventManager.h"
 #include "KX_ObstacleSimulation.h"
 
 #ifdef WITH_BULLET
-#include "KX_SoftBodyDeformer.h"
+#  include "KX_SoftBodyDeformer.h"
 #endif
 
-#include "KX_Light.h"
+#ifdef WITH_PYTHON
+#  include "KX_PythonCallBack.h"
+#endif
 
-#include <stdio.h>
+#include "KX_Light.h"
 
 #include "BLI_task.h"