This is subtle, but add_definitions() also adds definitions to the windres command line when building with MinGW, and this causes subsequent barfage because windres doesn't grok the -static-libgcc flag.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4726 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15394d6..d39a2b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,7 +144,7 @@
     else()
       message(WARNING Cannot find static libstdc++.  TigerVNC will depend on dynamic libstdc++.)
     endif()
-    add_definitions(-static-libgcc)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
     set(CMAKE_SHARED_LINKER_FLAGS
       "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")