Parcourir la source

Workaround a linking issue when using MinGW >= 6.1.0.

Yao Wei Tjong 姚伟忠 il y a 9 ans
Parent
commit
13ed7bbbb6

+ 7 - 0
Source/Tools/RampGenerator/CMakeLists.txt

@@ -23,6 +23,13 @@
 # Define target name
 # Define target name
 set (TARGET_NAME RampGenerator)
 set (TARGET_NAME RampGenerator)
 
 
+# Define preprocessor macros
+if (MINGW AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.1.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.1.0) AND URHO3D_LIB_TYPE STREQUAL STATIC)
+    # Workaround the "multiple definition of" linking issue in STATIC build
+else ()
+    add_definitions (-DSTB_IMAGE_WRITE_IMPLEMENTATION)
+endif ()
+
 # Define source files
 # Define source files
 define_source_files ()
 define_source_files ()
 
 

+ 0 - 4
Source/Tools/RampGenerator/RampGenerator.cpp

@@ -28,10 +28,6 @@
 #include <windows.h>
 #include <windows.h>
 #endif
 #endif
 
 
-
-#define STB_IMAGE_IMPLEMENTATION
-#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include <STB/stb_image.h>
 #include <STB/stb_image_write.h>
 #include <STB/stb_image_write.h>
 
 
 #include <Urho3D/DebugNew.h>
 #include <Urho3D/DebugNew.h>