Add ASAN build configuration
[alexxy/gromacs.git] / cmake / gmxBuildTypeTSAN.cmake
similarity index 90%
rename from cmake/gmxBuildTypeThreadSanitizer.cmake
rename to cmake/gmxBuildTypeTSAN.cmake
index 3c513d7479e69761b625527c56754b14db10dec4..550edb88f91bbb5a93eef918f54a12355201ea7b 100644 (file)
@@ -32,7 +32,7 @@
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-# Custom build type "ThreadSanitizer", to be used for compiling GROMACS 
+# Custom build type "TSAN", to be used for compiling GROMACS 
 # with clang 3.4 or gcc 4.8 (currently pre-release) with ThreadSanitizer
 # (aka "TSan") turned on, so that the tests can be run to detect data races.
 #
@@ -73,13 +73,13 @@ foreach(_language C CXX)
     string(REPLACE "X" "+" _human_readable_language ${_language})
 
     if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
-        set(CMAKE_${_language}_FLAGS_THREADSANITIZER "${_flags} -pie -fPIE" CACHE STRING "${_human_readable_language} flags for thread sanitizer")
+        set(CMAKE_${_language}_FLAGS_TSAN "${_flags} -pie -fPIE" CACHE STRING "${_human_readable_language} flags for thread sanitizer")
     else()
-        set(CMAKE_${_language}_FLAGS_THREADSANITIZER ${_flags} CACHE STRING "${_human_readable_language} flags for thread sanitizer")
+        set(CMAKE_${_language}_FLAGS_TSAN ${_flags} CACHE STRING "${_human_readable_language} flags for thread sanitizer")
     endif()
-    mark_as_advanced(CMAKE_${_language}_FLAGS_THREADSANITIZER)
+    mark_as_advanced(CMAKE_${_language}_FLAGS_TSAN)
     string(TOUPPER "${CMAKE_BUILD_TYPE}" _cmake_build_type)
-    if (_cmake_build_type STREQUAL THREADSANITIZER)
+    if (_cmake_build_type STREQUAL TSAN)
         set(TMPI_ATOMICS_DISABLED 1)
         set(TMPI_ATOMICS 0)
         if (NOT((CMAKE_${_language}_COMPILER_ID MATCHES "Clang" AND