Skip to content

Commit

Permalink
Special workaround to build WinRel without console
Browse files Browse the repository at this point in the history
  • Loading branch information
LaG1924 committed Jan 14, 2018
1 parent c9ee438 commit dc5a039
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set(PLATFORM_LIBRARIES "pthread" "stdc++fs")
endif ()

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
endif(MSVC)
if(MSVC AND CMAKE_BUILD_TYPE MATCHES Release)
target_compile_definitions(AltCraft PRIVATE USE_SDL_MAIN)
set_target_properties(AltCraft PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
endif(MSVC AND CMAKE_BUILD_TYPE MATCHES Release)

target_link_libraries(AltCraft ${PLATFORM_LIBRARIES})

Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ void initLogger() {
LOG(INFO) << "Logger is configured";
}

#ifndef USE_SDL_MAIN
#undef main
#endif

int main(int argc, char** argv) {
srand(time(0));
Expand Down

0 comments on commit dc5a039

Please sign in to comment.