Add Clang support, be explicit about MSVC flags

This commit is contained in:
Joel Johnson 2019-12-31 20:38:39 -07:00
parent 30eb5ce128
commit 8a5e792f20

View File

@ -10,9 +10,9 @@ set(EXAMPLES
add_definitions(-D_GLIBCXX_USE_CXX11_ABI) add_definitions(-D_GLIBCXX_USE_CXX11_ABI)
set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS}) set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra ")
else() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_definitions( add_definitions(
-D_SCL_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS