aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fef8144..e24cc1d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,13 +2,16 @@ cmake_minimum_required(VERSION 2.8.11)
project(relocate C)
set(VERSION "1.2.2")
set(CMAKE_C_STANDARD 99)
-if(MSVC)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /Wall")
-else()
+if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"
+ OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra")
+elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+ # C4996: The POSIX name for this item is deprecated
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /W4 /wd4996")
endif()
enable_testing()
+include(CTest)
add_subdirectory(test)
configure_file(version.h.in version.h)