diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bfd582..b432b65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR) CMAKE_POLICY(VERSION 2.6) FIND_PACKAGE(Torch REQUIRED) -IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89 -pedantic") -ENDIF() +INCLUDE(CheckCCompilerFlag) +CHECK_C_COMPILER_FLAG(-pedantic C_HAS_PEDANTIC) +IF (C_HAS_PEDANTIC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic") +ENDIF () SET(src init.c) |