Skip to content

Commit

Permalink
Updated CMakeLists, working on Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Hofmann committed Sep 24, 2019
1 parent 7f3955a commit a71495e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (UNIX AND APPLE)
set(LIBS "${LIBS}" "-framework OpenGL")
elseif (WIN32)
message(STATUS "Windows build")
set(CMAKE_CXX_FLAGS "/W2")
set(CMAKE_SHARED_LINKER_FLAGS "")
elseif (UNIX AND NOT APPLE)
message(STATUS "Linux build")
set(LIBS "${LIBS}" "-lpng")
Expand All @@ -34,11 +34,13 @@ elseif (UNIX AND NOT APPLE)
set(LIBS "${LIBS}" "-lXtst")
endif()

set(CMAKE_CXX_FLAGS "-Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
message(STATUS "No MSVC compiler in use, adding compile flags -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
message(STATUS "No MSVC compiler in use")
set(CMAKE_CXX_FLAGS "-Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
else()
message(STATUS "MSVC compiler in use")
set(CMAKE_CXX_FLAGS "/Wall /W2 /O2")
endif()

add_compile_definitions(NAPI_CPP_EXCEPTIONS)
Expand Down

0 comments on commit a71495e

Please sign in to comment.