From 75a86d6a8e48c988294303a2390a0c7b86cca417 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Jun 2015 04:52:52 +1000 Subject: Fix for building without Python --- source/gameengine/Expressions/CMakeLists.txt | 10 ++++++++-- source/gameengine/Ketsji/KX_GameObject.cpp | 7 +++++-- source/gameengine/Ketsji/KX_MouseActuator.cpp | 4 ++-- source/gameengine/Ketsji/KX_MouseActuator.h | 5 +++++ source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 2 ++ source/gameengine/Ketsji/KX_Scene.cpp | 11 +++++++---- 6 files changed, 29 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index 48c10d75a17..f827a9528b4 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -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}") diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index e77960b99b1..34d50e24741 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -69,10 +69,13 @@ #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. diff --git a/source/gameengine/Ketsji/KX_MouseActuator.cpp b/source/gameengine/Ketsji/KX_MouseActuator.cpp index c372e6e9ce2..154ad1da3a1 100644 --- a/source/gameengine/Ketsji/KX_MouseActuator.cpp +++ b/source/gameengine/Ketsji/KX_MouseActuator.cpp @@ -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 */ diff --git a/source/gameengine/Ketsji/KX_MouseActuator.h b/source/gameengine/Ketsji/KX_MouseActuator.h index bf90bd21dac..e244e271428 100644 --- a/source/gameengine/Ketsji/KX_MouseActuator.h +++ b/source/gameengine/Ketsji/KX_MouseActuator.h @@ -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 diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index c2c83266791..c3c693ed55f 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -36,6 +36,8 @@ # pragma warning(disable:4786) #endif +#include + #include "MT_Point3.h" #include "RAS_FramingManager.h" #include "RAS_ICanvas.h" diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 25755f7127b..2adc20b0288 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -35,6 +35,8 @@ # pragma warning (disable:4786) #endif +#include + #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" @@ -95,12 +96,14 @@ #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 +#include "KX_Light.h" #include "BLI_task.h" -- cgit v1.2.3