...
 
Commits (3)
  • Thomas Debesse's avatar
    cmake: make tools target the console subsystem on Windows · f2f321e9
    Thomas Debesse authored
    previously on Windows the stdout stuff was only printed on MinTTY console or SSH shell,
    this change makes the tools to target the console subsystem so they also print stdout
    on cmd console.
    
    this also makes the tool spawning a cmd console windows when not started from a console,
    allowing people to monitor what is printed.
    
    this is done by adding a console_app() cmake macro that enables the -mconsole linker flag.
    For exhaustivity an extraneous window_app() macro is done too that enables the -mwindows
    flag. The -mwindows looks to be implicit, but making this macro explicit and using it
    keeps the CMakeLists.txt file self documenting which exe has to be compiled with -mconsole,
    which one has to be compiled with -mwindows, and which one has to be compiled with both.
    
    this is a way to check if an exe targets only the windows subsystem:
    
    $ objdump -p netradiant.exe | egrep '^Subsystem'
    Subsystem		00000002	(Windows GUI)
    
    this is a way to check if an exe targets the console subsystem:
    
    $ objdump -p q3map2.exe | egrep '^Subsystem'
    Subsystem		00000003	(Windows CUI)
    
    note that this one targets both console and windows subsystem, only console is reported:
    
    $ objdump -p q2map.exe | egrep '^Subsystem'
    Subsystem		00000003	(Windows CUI)
    f2f321e9
  • Thomas Debesse's avatar
    cmake: do not use WIN32 for console tools · 0f91bcf3
    Thomas Debesse authored
    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
    0f91bcf3
  • Thomas Debesse's avatar
    Merge branch 'winconsole' into 'master' · 5bacc7d8
    Thomas Debesse authored
    make tools target the console subsystem on Windows
    
    See merge request !137
    5bacc7d8
......@@ -90,6 +90,7 @@ set(RADIANTLIST
xmlstuff.cpp xmlstuff.h
xywindow.cpp xywindow.h
)
if (WIN32)
list(APPEND RADIANTLIST multimon.cpp multimon.h)
endif ()
......@@ -126,6 +127,7 @@ target_link_libraries(${RADIANT_BASENAME}
uilib
xmllib
)
if (X11_LIBRARIES)
target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES})
endif ()
......
......@@ -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
......@@ -56,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
......
......@@ -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
......
......@@ -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
......@@ -155,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
......