Browse Source

Merge pull request #208 from libRocket/feature/osx-python-fixes

Various fixes to resolve issues with building python modules on OSX
David Wimsey 11 years ago
parent
commit
9c043cf763

+ 9 - 1
Build/CMakeLists.txt

@@ -151,7 +151,7 @@ if(BUILD_PYTHON_BINDINGS)
     find_package(Boost 1.40.0 COMPONENTS python REQUIRED)
     if(Boost_FOUND)
         include_directories(${Boost_INCLUDE_DIR})
-        list(APPEND PY_BINDINGS_LINK_LIBS ${Boost_LIBRARIES})
+        list(APPEND PY_BINDINGS_LINK_LIBS ${PYTHON_LIBRARY} ${Boost_LIBRARIES})
     endif()
 
 endif()
@@ -230,6 +230,14 @@ if(BUILD_PYTHON_BINDINGS)
                             ${Py${library}_PUB_HDR_FILES}
         )
 
+    if(APPLE)
+	if(NOT IOS)
+    		set_target_properties(${NAME} PROPERTIES
+    						OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)"
+    		)
+	endif(NOT IOS)
+    endif(APPLE)
+
         set_target_properties(${NAME} PROPERTIES PREFIX "")
 
         install(TARGETS ${NAME}

+ 2 - 1
Samples/pyinvaders/src/ElementGame.cpp

@@ -25,13 +25,14 @@
  *
  */
 
+#include <Rocket/Core/Python/Python.h>
+
 #include "ElementGame.h"
 #include <Rocket/Core/ElementDocument.h>
 #include <Rocket/Core/Input.h>
 #include <Rocket/Core/Factory.h>
 #include <Rocket/Core/Python/ElementInstancer.h>
 #include <Rocket/Core/Python/ElementWrapper.h>
-#include <Rocket/Core/Python/Python.h>
 #include "Defender.h"
 #include "Game.h"
 

+ 2 - 1
Samples/pyinvaders/src/PythonInterface.h

@@ -28,9 +28,10 @@
 #ifndef PYTHONINTERFACE_H
 #define PYTHONINTERFACE_H
 
-#include <Rocket/Core/String.h>
 #include <Rocket/Core/Python/Python.h>
 
+#include <Rocket/Core/String.h>
+
 /**
 	Creates and maintains the python interface to Invaders.
 

+ 2 - 1
Samples/pyinvaders/src/main.cpp

@@ -26,6 +26,8 @@
  */
 
 #define _WIN32_WINNT 0x0500
+#include "PythonInterface.h"
+
 #include <Rocket/Core.h>
 #include <Rocket/Controls.h>
 #include <Rocket/Debugger.h>
@@ -36,7 +38,6 @@
 #include "DecoratorInstancerStarfield.h"
 #include "ElementGame.h"
 #include "HighScores.h"
-#include "PythonInterface.h"
 
 Rocket::Core::Context* context = NULL;
 

+ 3 - 3
Source/Controls/Python/precompiled.h

@@ -25,9 +25,9 @@
  *
  */
 
+// Python header.
+#include "../../../Include/Rocket/Core/Python/Python.h"
+
 // Rocket core and controls.
 #include "../../../Include/Rocket/Core.h"
 #include "../../../Include/Rocket/Controls.h"
-
-// Python header.
-#include "../../../Include/Rocket/Core/Python/Python.h"

+ 3 - 3
Source/Core/Python/precompiled.h

@@ -25,8 +25,8 @@
  *
  */
 
-// Rocket core.
-#include "../../../Include/Rocket/Core.h"
-
 // Python header.
 #include "../../../Include/Rocket/Core/Python/Python.h"
+
+// Rocket core.
+#include "../../../Include/Rocket/Core.h"