summaryrefslogtreecommitdiffstats
path: root/cmake_unofficial/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'cmake_unofficial/CMakeLists.txt')
-rw-r--r--cmake_unofficial/CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt
index 4c3eb65..a986f43 100644
--- a/cmake_unofficial/CMakeLists.txt
+++ b/cmake_unofficial/CMakeLists.txt
@@ -17,7 +17,12 @@ ENDIF()
option(BUILD_TOOLS "Build the command line tools" ON)
option(BUILD_LIBS "Build the libraries in addition to the tools" ON)
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+ SET(GNU_COMPATIBLE_COMPILER 1)
+ENDIF()
+
+if(GNU_COMPATIBLE_COMPILER)
if(UNIX AND BUILD_LIBS)
add_definitions(-fPIC)
endif()
@@ -68,7 +73,7 @@ endif()
if(MSVC)
ADD_DEFINITIONS("-W4")
endif()
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+if(GNU_COMPATIBLE_COMPILER)
ADD_DEFINITIONS("-Wall")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
@@ -78,7 +83,7 @@ ADD_DEFINITIONS("-Wshadow")
ADD_DEFINITIONS("-Wcast-align")
ADD_DEFINITIONS("-Wstrict-prototypes")
endif(CMAKE_COMPILER_IS_GNUCXX)
-if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND
+if(GNU_COMPATIBLE_COMPILER AND
(NOT CMAKE_SYSTEM_NAME MATCHES "SunOS"))
ADD_DEFINITIONS("-std=c99")
endif()