Skip to content

Commit

Permalink
Hide console window on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
theo543 committed Apr 10, 2023
1 parent 2ec9516 commit 3a6dfa7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ endif()

###############################################################################

if(WIN32)
# This sets the PE header subsystem property to GUI, hiding the terminal.
set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE)
# On MSVC we have to tell the compiler we're still using main instead of WinMain.
target_link_options(${PROJECT_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/ENTRY:mainCRTStartup>)
endif()

###############################################################################

# copy binaries to "bin" folder; these are uploaded as artifacts on each release
# update name in .github/workflows/cmake.yml:29 when changing "bin" name here
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
Expand Down

0 comments on commit 3a6dfa7

Please sign in to comment.