Fixed bug 2238 - Enable GCC atomics for clang
authorSam Lantinga <slouken@libsdl.org>
Sat, 16 Nov 2013 11:58:21 -0800
changeset 7999 2c9aedfba740
parent 7998 097e3fac1979
child 8000 fe9403d0bc9d
Fixed bug 2238 - Enable GCC atomics for clang Marcus von Appen clang provides support for optimized atomics. The attached patch enables the cmake build system to take clang into account on checking for atomics.
CMakeLists.txt
--- a/CMakeLists.txt	Sat Nov 16 11:54:16 2013 -0800
+++ b/CMakeLists.txt	Sat Nov 16 11:58:21 2013 -0800
@@ -266,7 +266,7 @@
 set(HAVE_ASSERTIONS ${ASSERTIONS})
 
 # Compiler option evaluation
-if(USE_GCC)
+if(USE_GCC OR USE_CLANG)
   if(DEPENDENCY_TRACKING)
     check_c_source_compiles("
         #if !defined(__GNUC__) || __GNUC__ < 3
@@ -314,7 +314,7 @@
       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
     endif(HAIKU)
   endif(HAVE_GCC_WALL)
-endif(USE_GCC)
+endif(USE_GCC OR USE_CLANG)
 
 if(ASSEMBLY)
   if(USE_GCC OR USE_CLANG)