]> git.mxchange.org Git - simgear.git/commitdiff
Work around MSVC linker bug with classes derived from i/ofstream
authorThomas Geymayer <tomgey@gmail.com>
Sat, 27 Apr 2013 21:44:32 +0000 (23:44 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Sat, 27 Apr 2013 21:44:32 +0000 (23:44 +0200)
CMakeLists.txt

index 0a0d6278ba35d225d2d2d8e6bf81576d228017a9..854db0c9e4552a186ab57b7696fe0ab6663c0b7d 100644 (file)
@@ -317,6 +317,9 @@ if(WIN32)
         # endforeach(warning)
         
         set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /wd4996 /wd4250 -Dstrdup=_strdup")
+        if (${MSVC_VERSION} GREATER 1599)
+            set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
+        endif (${MSVC_VERSION} GREATER 1599)
     endif(MSVC)
     
     # assumed on Windows
@@ -328,6 +331,7 @@ endif(WIN32)
 
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS_C} ${MSVC_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_CXX} ${MSVC_FLAGS} ${BOOST_CXX_FLAGS}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}")
 
 include_directories(${PROJECT_SOURCE_DIR})
 include_directories(${PROJECT_SOURCE_DIR}/simgear/canvas/ShivaVG/include)