]> git.cworth.org Git - apitrace/blobdiff - CMakeLists.txt
tracedump: Add tri-state --color option (auto, always, or never)
[apitrace] / CMakeLists.txt
index d91d326d5453ac78ac110809c473b0fd0acd6f12..db3d9ab9e67693829783661fd4606d6ebf9b5c19 100755 (executable)
@@ -38,7 +38,7 @@ endif ()
 
 if (WIN32)
     find_package (DirectX)
-elif (APPLE)
+elseif (APPLE)
 else ()
     find_package (X11 REQUIRED)
 
@@ -106,6 +106,22 @@ else ()
     add_definitions (-Wno-sign-compare) # comparison between signed and unsigned integer expressions
 endif ()
 
+if (MINGW)
+    # Avoid depending on MinGW runtime DLLs
+    check_cxx_compiler_flag (-static-libgcc HAVE_STATIC_LIBGCC_FLAG)
+    if (HAVE_STATIC_LIBGCC_FLAG)
+        set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
+        set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
+        set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libgcc")
+    endif ()
+    check_cxx_compiler_flag (-static-libstdc++ HAVE_STATIC_LIBSTDCXX_FLAG)
+    if (HAVE_STATIC_LIBSTDCXX_FLAG)
+        set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
+        set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
+        set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libstdc++")
+    endif ()
+endif ()
+
 
 # Put all executables into the same top level build directory, regardless of
 # which subdirectory they are declared
@@ -400,6 +416,7 @@ add_executable (glretrace
     glstate.cpp
     glstate_params.cpp
     retrace.cpp
+    retrace_stdc.cpp
     glws.cpp
     ${glws_os}
     ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp