summaryrefslogtreecommitdiff
path: root/api_test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-24 21:34:19 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-24 21:34:19 -0800
commitbe834300a31ffac837b6434650c206aa8e292e1b (patch)
treec6353469918635bd2a08b1c8b83074f8e3a67b00 /api_test
parent6bd809b6b4836e1026998c2d4c1fc76506de3e8f (diff)
parent9de6890f11cf6d1947132bbf90e3735aabb0a683 (diff)
Merge pull request #218 from nwellnhof/windows_fixes
Windows fixes
Diffstat (limited to 'api_test')
-rw-r--r--api_test/CMakeLists.txt17
1 files changed, 11 insertions, 6 deletions
diff --git a/api_test/CMakeLists.txt b/api_test/CMakeLists.txt
index b2ab2c8..c25b6c1 100644
--- a/api_test/CMakeLists.txt
+++ b/api_test/CMakeLists.txt
@@ -10,10 +10,15 @@ include_directories(
target_link_libraries(api_test libcmark)
# Compiler flags
-if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
- set_target_properties(api_test PROPERTIES COMPILE_FLAGS
- "-std=c99 -Wall -Wextra"
- )
-elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
- set_target_properties(api_test PROPERTIES COMPILE_FLAGS "/TP /W4")
+if(MSVC)
+ # Force to always compile with W4
+ if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
+ string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ else()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
+ endif()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4244 /wd4267 /wd4706 /wd4800 /D_CRT_SECURE_NO_WARNINGS")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP")
+elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99 -pedantic")
endif()