Backport compiler options from premake configuration. Refs #240.

This commit is contained in:
Andrii Senkovych
2015-02-11 14:10:09 +02:00
parent 9122a78a46
commit 3ae2a29986
3 changed files with 23 additions and 2 deletions

View File

@@ -14,6 +14,14 @@ set(EXAMPLES
simplewriter
tutorial)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
foreach (example ${EXAMPLES})
add_executable(${example} ${example}/${example}.cpp)
endforeach()