Skip to content

Commit

Permalink
Tell the linker that this is a GUI-application
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Agafonov committed Aug 16, 2021
1 parent 0311895 commit 033da33
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
cmake_minimum_required(VERSION 3.5)


project(SimpleApp LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
# target_link_options(target PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:mainCRTStartup")
add_definitions(-D__PRETTY_FUNCTION__ -D__FUNCSIG__)
endif()

set(SOURCES test/main.cpp
test/snakegame.cpp
test/texttest.cpp
Expand Down Expand Up @@ -54,3 +49,10 @@ if (WIN32)
endif (WIN32)

add_executable(SimpleApp ${SOURCES} ${HEADERS})

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_definitions(-D__PRETTY_FUNCTION__ -D__FUNCSIG__)

# Tell the linker that this is a GUI-application
target_link_options(SimpleApp PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:mainCRTStartup")
endif()

0 comments on commit 033da33

Please sign in to comment.