diff options
author | Chris Robinson <[email protected]> | 2014-04-19 02:11:04 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-04-19 02:11:04 -0700 |
commit | 59fc9aac0ee41518dba0cbd2f1518decffeaa480 (patch) | |
tree | ac9793a8e3015e595b2f679b82b7f11e4472f717 /CMakeLists.txt | |
parent | 8badd3740e1a2e13affb4553c69ca44b1649035b (diff) |
Use C11 alignas when available
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d440aab..5e84cd64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,6 +176,15 @@ CHECK_C_SOURCE_COMPILES( }" HAVE_C11_STATIC_ASSERT) +# Check if we have C11 alignas +CHECK_C_SOURCE_COMPILES( +"_Alignas(4) int foo; + int main() + { + return 0; + }" +HAVE_C11_ALIGNAS) + # Add definitions, compiler switches, etc. INCLUDE_DIRECTORIES("${OpenAL_SOURCE_DIR}/include" "${OpenAL_BINARY_DIR}") IF(CMAKE_VERSION VERSION_LESS "2.8.8") @@ -319,6 +328,7 @@ ENDIF() CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(printf, 1, 2))); int main() {return 0;}" HAVE_GCC_FORMAT) +CHECK_INCLUDE_FILE(stdalign.h HAVE_STDALIGN_H) IF(NOT HAVE_C99_VLA) CHECK_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H) ENDIF() |