From fa64f7b6aa8502cd92cdfb3dddfaf2a548eabc64 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Sat, 27 Apr 2013 23:44:32 +0200 Subject: [PATCH] Work around MSVC linker bug with classes derived from i/ofstream --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a0d6278..854db0c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) -- 2.39.5