]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
cmake: do not use WIN32 for console tools 137/head
authorThomas Debesse <dev@illwieckz.net>
Fri, 5 Jul 2019 20:25:34 +0000 (22:25 +0200)
committerThomas Debesse <dev@illwieckz.net>
Fri, 5 Jul 2019 20:33:33 +0000 (22:33 +0200)
allow them to output stdout on console and spawn a console if required

it's not very intuitive and explicit but the WIN32 cmake keyword
in add_executable call is to not target the console subsystem but
only the graphical one

so console tools just have to not use that keyword, even if they imay
display a window like when doing q2map -glview

then the WIN32 keyword is a kind of “no console” keyword

CMakeLists.txt
radiant/CMakeLists.txt
tools/quake2/CMakeLists.txt
tools/quake2/qdata_heretic2/CMakeLists.txt
tools/quake3/CMakeLists.txt

index 6afa468ae661047d91551b8f78260aa2d8ad06a5..1a414aa15ca54d811fe04400a1c221d3914f1622 100644 (file)
@@ -266,18 +266,6 @@ 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)
index 144bf320a3381285307a39f31f218c3558d624bf..93fedea428a461f615136ae3964c7d2e9e5f0238 100644 (file)
@@ -128,8 +128,6 @@ target_link_libraries(${RADIANT_BASENAME}
     xmllib
 )
 
-window_app(${RADIANT_BASENAME})
-
 if (X11_LIBRARIES)
     target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES})
 endif ()
index 20d7ff8247c2261089852a0c08fac5ca76740ecc..b36be1ae49402a3dce35435183a93f0bd96d737f 100644 (file)
@@ -4,7 +4,7 @@ find_package(LibXml2 REQUIRED)
 include_directories(${LIBXML2_INCLUDE_DIR})
 
 radiant_tool(q2map
-    WIN32 q2map/q2map.rc
+    q2map/q2map.rc
 
     common/bspfile.c common/bspfile.h
     common/cmdlib.c common/cmdlib.h
@@ -46,9 +46,6 @@ radiant_tool(q2map
     q2map/writebsp.c
 )
 
-console_app(q2map)
-window_app(q2map)
-
 target_compile_definitions(q2map
     PRIVATE
 )
@@ -59,7 +56,7 @@ target_link_libraries(q2map
 )
 
 radiant_tool(qdata3
-    WIN32 qdata/qdata.rc
+    qdata/qdata.rc
 
     common/bspfile.c common/bspfile.h
     common/cmdlib.c common/cmdlib.h
@@ -84,8 +81,6 @@ radiant_tool(qdata3
     qdata/video.c
 )
 
-console_app(qdata3)
-
 target_compile_definitions(qdata3
     PRIVATE
 )
index d9c5b43600cc44a0f9421742ea041eabeceede6b..34131623ae613ebb8bfd366ee3a6348622a2201b 100644 (file)
@@ -6,7 +6,7 @@ find_package(LibXml2 REQUIRED)
 include_directories(${LIBXML2_INCLUDE_DIR})
 
 radiant_tool(h2data
-    WIN32 h2data.rc
+    h2data.rc
 
     common/bspfile.c common/bspfile.h
     common/cmdlib.c common/cmdlib.h
@@ -56,8 +56,6 @@ radiant_tool(h2data
     video.c
 )
 
-console_app(h2data)
-
 target_compile_definitions(h2data
     PRIVATE
 )
index d2d3ae2b342edfc4d62fa43e7e9318e84068c551..41af91c51da4117a8c6685c92f3a89d75e513803 100644 (file)
@@ -60,7 +60,7 @@ set(q3map2_games
         )
 
 radiant_tool(q3map2
-        WIN32 q3map2/q3map2.rc
+        q3map2/q3map2.rc
 
         common/cmdlib.c common/cmdlib.h
         common/imagelib.c common/imagelib.h
@@ -127,8 +127,6 @@ radiant_tool(q3map2
         q3map2/writebsp.c
         )
 
-console_app(q3map2)
-
 if (BUILD_CRUNCH)
         set(OPTIONAL_IMAGE_LIBRARIES crnrgba)
         set(OPTIONAL_IMAGE_DEFINES BUILD_CRUNCH=1)
@@ -157,7 +155,7 @@ target_link_libraries(q3map2
         )
 
 radiant_tool(q3data
-        WIN32 q3data/q3data.rc
+        q3data/q3data.rc
 
         common/aselib.c common/aselib.h
         common/bspfile.c common/bspfile.h
@@ -181,8 +179,6 @@ radiant_tool(q3data
         q3data/video.c
         )
 
-console_app(q3data)
-
 target_link_libraries(q3data
         ${GLIB_LIBRARIES}
         ${LIBXML2_LIBRARIES}