Fixed bug 2238 - Enable GCC atomics for clang
authorSam Lantinga <slouken@libsdl.org>
Sat, 16 Nov 2013 11:58:21 -0800
changeset 79992c9aedfba740
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
     1.1 --- a/CMakeLists.txt	Sat Nov 16 11:54:16 2013 -0800
     1.2 +++ b/CMakeLists.txt	Sat Nov 16 11:58:21 2013 -0800
     1.3 @@ -266,7 +266,7 @@
     1.4  set(HAVE_ASSERTIONS ${ASSERTIONS})
     1.5  
     1.6  # Compiler option evaluation
     1.7 -if(USE_GCC)
     1.8 +if(USE_GCC OR USE_CLANG)
     1.9    if(DEPENDENCY_TRACKING)
    1.10      check_c_source_compiles("
    1.11          #if !defined(__GNUC__) || __GNUC__ < 3
    1.12 @@ -314,7 +314,7 @@
    1.13        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
    1.14      endif(HAIKU)
    1.15    endif(HAVE_GCC_WALL)
    1.16 -endif(USE_GCC)
    1.17 +endif(USE_GCC OR USE_CLANG)
    1.18  
    1.19  if(ASSEMBLY)
    1.20    if(USE_GCC OR USE_CLANG)