]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - CMakeLists.txt
cmake: make tools target the console subsystem on Windows
[xonotic/netradiant.git] / CMakeLists.txt
index 1a414aa15ca54d811fe04400a1c221d3914f1622..6afa468ae661047d91551b8f78260aa2d8ad06a5 100644 (file)
@@ -266,6 +266,18 @@ if (BUILD_BINARIES)
         string(REGEX REPLACE "^[.]" "" RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
     endif ()
 
+    macro (console_app name)
+        if (WIN32)
+            target_link_libraries(${name} -mconsole)
+        endif ()
+    endmacro ()
+
+    macro (window_app name)
+        if (WIN32)
+            target_link_libraries(${name} -mwindows)
+        endif ()
+    endmacro ()
+
     macro (radiant_tool name)
         if (BUNDLE_LIBRARIES AND WIN32)
             add_executable(${name} ${ARGN} ${PROJECT_SOURCE_DIR}/include/lib.rc)