浏览代码

Make Release-Build compile without linker errors. This is probably caused because XCode is incapable of handling header files correctly.

Sam Jaffe 6 年之前
父节点
当前提交
c62b7941af

+ 2 - 2
engine/engine.xcodeproj/project.pbxproj

@@ -16,9 +16,9 @@
 		CD62FD3C229370E200376440 /* libjsoncpp.1.8.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD62FD3922936E9C00376440 /* libjsoncpp.1.8.4.dylib */; };
 		CD62FD402293746900376440 /* serial.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD62FD3E2293746900376440 /* serial.cxx */; };
 		CD7E87792295FAB400D877FE /* libgameutils.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD7E87782295FAB400D877FE /* libgameutils.dylib */; };
-		CDB1F8C81D7A312B00700C6B /* game_dispatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB1F8C61D7A312B00700C6B /* game_dispatch.cpp */; };
+		CDB1F8C81D7A312B00700C6B /* game_dispatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB1F8C61D7A312B00700C6B /* game_dispatch.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
 		CDB1F8CC1D7A319A00700C6B /* scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB1F8CA1D7A319A00700C6B /* scene.cpp */; };
-		CDB1F8D21D7A32A300700C6B /* events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB1F8D01D7A32A300700C6B /* events.cpp */; };
+		CDB1F8D21D7A32A300700C6B /* events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDB1F8D01D7A32A300700C6B /* events.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */

+ 3 - 2
engine/include/game/engine/game_dispatch.hpp

@@ -16,7 +16,6 @@
 
 #include "engine_fwd.hpp"
 #include "events.hpp"
-#include "game/engine/fps_counter.hpp"
 #include "game/util/time.hpp"
 
 namespace graphics {
@@ -24,6 +23,8 @@ namespace graphics {
 }
 
 namespace engine {
+  class fps_counter;
+
   class game_dispatch {
   public:
     game_dispatch(std::shared_ptr<graphics::renderer> renderer);
@@ -46,7 +47,7 @@ namespace engine {
     std::shared_ptr<graphics::renderer> renderer;
     math::vec2 screen_size;
     env::clock::duration minimum_frame_duration;
-    fps_counter counter;
+    std::unique_ptr<fps_counter> counter;
 
     using scene_t = std::shared_ptr<scene>;
     std::unordered_map<scene_id_t, scene_t> scenes;

+ 6 - 4
engine/src/game_dispatch.cpp

@@ -10,6 +10,7 @@
 #include "game/engine/game_dispatch.hpp"
 
 #include "game/engine/events.hpp"
+#include "game/engine/fps_counter.hpp"
 #include "game/engine/scene.hpp"
 #include "game/graphics/object.hpp"
 #include "game/graphics/renderer.hpp"
@@ -25,8 +26,9 @@ namespace engine {
 
   game_dispatch::game_dispatch(std::shared_ptr<graphics::renderer> renderer)
       : renderer(renderer), screen_size(env::screen_size()),
-        minimum_frame_duration(env::fps::v60), counter(minimum_frame_duration),
-        scenes(), current_timestamp(env::clock::now()), curr_scene() {}
+        minimum_frame_duration(env::fps::v60),
+        counter(new fps_counter(minimum_frame_duration)), scenes(),
+        current_timestamp(env::clock::now()), curr_scene() {}
 
   game_dispatch::current_scene_info::current_scene_info() {}
 
@@ -66,14 +68,14 @@ namespace engine {
 
   void game_dispatch::update() {
     env::clock::tick t = next_frame();
-    counter.set_frame_step(t.since);
+    counter->set_frame_step(t.since);
     //    curr_scene.ptr->update(std::chrono::duration<float>(t.since).count());
   }
 
   void game_dispatch::render() {
     graphics::batch_renderer batch(renderer.get());
     batch.clear();
-    for (auto & obj : counter.glyphs()) {
+    for (auto & obj : counter->glyphs()) {
       batch.draw(obj);
     }
     //    curr_scene.ptr->render(batch);

+ 7 - 7
graphics/graphics.xcodeproj/project.pbxproj

@@ -7,17 +7,17 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		CD1C82BD22988EC700825C4E /* matrix.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD1C82BC22988EC700825C4E /* matrix.cxx */; };
-		CD3AC6F21D2C03B7002B4BB0 /* material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC6F01D2C03B7002B4BB0 /* material.cpp */; };
-		CD3AC6F81D2C0518002B4BB0 /* texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC6F61D2C0518002B4BB0 /* texture.cpp */; };
-		CD3AC6FD1D2C06B5002B4BB0 /* shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC6FB1D2C06B5002B4BB0 /* shader.cpp */; };
-		CD3AC7191D2C0950002B4BB0 /* shader_program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC7171D2C0950002B4BB0 /* shader_program.cpp */; };
-		CD3AC7261D2C0C63002B4BB0 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC7241D2C0C63002B4BB0 /* object.cpp */; };
+		CD1C82BD22988EC700825C4E /* matrix.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD1C82BC22988EC700825C4E /* matrix.cxx */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
+		CD3AC6F21D2C03B7002B4BB0 /* material.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC6F01D2C03B7002B4BB0 /* material.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
+		CD3AC6F81D2C0518002B4BB0 /* texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC6F61D2C0518002B4BB0 /* texture.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
+		CD3AC6FD1D2C06B5002B4BB0 /* shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC6FB1D2C06B5002B4BB0 /* shader.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
+		CD3AC7191D2C0950002B4BB0 /* shader_program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC7171D2C0950002B4BB0 /* shader_program.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
+		CD3AC7261D2C0C63002B4BB0 /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3AC7241D2C0C63002B4BB0 /* object.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
 		CD62FCF72290DC9000376440 /* helper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD62FCF52290DC9000376440 /* helper.hpp */; };
 		CD62FCF82290DC9000376440 /* opengl_helper.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD62FCF62290DC9000376440 /* opengl_helper.cxx */; };
 		CD62FCFA2290E2E500376440 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD62FCF92290E2E500376440 /* OpenGL.framework */; };
 		CD62FD062291970F00376440 /* libgameutils.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD62FD052291970F00376440 /* libgameutils.dylib */; };
-		CD62FD1E2292412900376440 /* renderer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD62FD1C2292412900376440 /* renderer.cxx */; };
+		CD62FD1E2292412900376440 /* renderer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD62FD1C2292412900376440 /* renderer.cxx */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; };
 		CD62FD222292C76B00376440 /* renderer_impl.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD62FD202292C76B00376440 /* renderer_impl.hpp */; };
 		CD62FD232292C76B00376440 /* opengl_renderer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD62FD212292C76B00376440 /* opengl_renderer.cxx */; };
 		CDA34D9A22517A3D008036A7 /* libmath.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CDA34D9922517A3D008036A7 /* libmath.dylib */; };

+ 2 - 1
math/math.xcodeproj/project.pbxproj

@@ -333,7 +333,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "mkdir -p ${BUILT_PRODUCTS_DIR}/usr/local/include/\ncp -r ${PROJECT_DIR}/include/* ${BUILT_PRODUCTS_DIR}/usr/local/include/\n";
+			shellScript = "mkdir -p ${BUILT_PRODUCTS_DIR}/usr/local/include/\nmkdir -p ${BUILT_PRODUCTS_DIR}/usr/local/include/vector/\nmkdir -p ${BUILT_PRODUCTS_DIR}/usr/local/include/matrix/\ncp -r ${PROJECT_DIR}/include/* ${BUILT_PRODUCTS_DIR}/usr/local/include/\ncp -r ${PROJECT_DIR}/vector/*.h* ${BUILT_PRODUCTS_DIR}/usr/local/include/vector/\ncp -r ${PROJECT_DIR}/matrix/*.h* ${BUILT_PRODUCTS_DIR}/usr/local/include/matrix/\n";
 		};
 /* End PBXShellScriptBuildPhase section */
 
@@ -544,6 +544,7 @@
 				GCC_ENABLE_CPP_EXCEPTIONS = YES;
 				GCC_ENABLE_CPP_RTTI = YES;
 				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+				OTHER_LDFLAGS = "-fvisibility=default";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;

+ 1 - 0
util/gameutils.xcodeproj/project.pbxproj

@@ -372,6 +372,7 @@
 				GCC_ENABLE_CPP_EXCEPTIONS = YES;
 				GCC_ENABLE_CPP_RTTI = YES;
 				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+				OTHER_LDFLAGS = "-fvisibility=default";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;