aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-10-09 01:46:02 -0700
committerChris Robinson <[email protected]>2012-10-09 01:46:02 -0700
commit8c3419ed48b0221816314f605b0a7c6e045d95dc (patch)
tree0f870aa1bd86669d330ad0f0bdbc2461299a2b78 /CMakeLists.txt
parenta98361ebbe62bf3d222b01aa018fe7ada6ef4332 (diff)
Define RESTRICT in config.h instead of alMain.h
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8ba10e2..2d22077d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,6 +86,7 @@ SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}")
SET(EXPORT_DECL "")
SET(ALIGN_DECL "")
+SET(RESTRICT_DECL "")
CHECK_TYPE_SIZE("long" SIZEOF_LONG)
@@ -94,8 +95,15 @@ CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
CHECK_C_SOURCE_COMPILES("int *restrict foo;
int main() {return 0;}" HAVE_RESTRICT)
-CHECK_C_SOURCE_COMPILES("int *__restrict foo;
- int main() {return 0;}" HAVE___RESTRICT)
+IF(HAVE_RESTRICT)
+ SET(RESTRICT_DECL "restrict")
+ELSE()
+ CHECK_C_SOURCE_COMPILES("int *__restrict foo;
+ int main() {return 0;}" HAVE___RESTRICT)
+ IF(HAVE___RESTRICT)
+ SET(RESTRICT_DECL "__restrict")
+ ENDIF()
+ENDIF()
# Add definitions, compiler switches, etc.