Skip to content

Commit

Permalink
CMake: Windows: Use Console subsystem only for Debug builds.
Browse files Browse the repository at this point in the history
Fix whitespace.
  • Loading branch information
Ghabry committed May 21, 2018
1 parent a7745ab commit 66baff0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,21 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^SDL.*$")
endif()

# Executable
add_executable(${PROJECT_NAME}_exe "src/main.cpp")
# Windows: Only open console for Debug builds
if(CMAKE_BUILD_TYPE MATCHES "Debug")
add_executable(${PROJECT_NAME}_exe "src/main.cpp")
else()
add_executable(${PROJECT_NAME}_exe WIN32 "src/main.cpp")
endif()

if(WIN32)
set_target_properties(${PROJECT_NAME}_exe PROPERTIES OUTPUT_NAME "Player")
set_target_properties(${PROJECT_NAME}_exe PROPERTIES OUTPUT_NAME "Player")
else()
set_target_properties(${PROJECT_NAME}_exe PROPERTIES OUTPUT_NAME "easyrpg-player")
set_target_properties(${PROJECT_NAME}_exe PROPERTIES OUTPUT_NAME "easyrpg-player")
endif()

# Add Windows resources
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if(WIN32)
target_sources(${PROJECT_NAME}_exe PRIVATE "resources/player.rc")
endif()

Expand Down

0 comments on commit 66baff0

Please sign in to comment.