From cd17ddaa0b3aa9e872ea220015afdde4d2ddb45a Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Mon, 11 Mar 2013 14:51:32 -0400 Subject: [PATCH] Add check for Clang. --- BPTCEncoder/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BPTCEncoder/CMakeLists.txt b/BPTCEncoder/CMakeLists.txt index 0fd10c8..d56eee6 100644 --- a/BPTCEncoder/CMakeLists.txt +++ b/BPTCEncoder/CMakeLists.txt @@ -145,7 +145,13 @@ IF( NOT HAS_INLINE_ASSEMBLY AND NOT HAS_INLINE_ASSEMBLY_WITH_FLAGS ) ENDIF() # Check to see whether or not our compiler supports atomic operations -IF( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX ) +IF( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) + SET( COMPILER_CLANG True ) +ELSEIF( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) + SET( COMPILER_GNU True ) +ENDIF() + +IF( COMPILER_CLANG OR COMPILER_GNU ) CHECK_CXX_SOURCE_RUNS(" int main() {