summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-word-size.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-07 11:40:57 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-07 11:40:57 +0200
commit74034c5bc3447cf628d13ca692beec7ffc0ce4cd (patch)
tree7ce191ecf80e7f86118eefb227d9b89391975244 /cmake/opentrack-word-size.cmake
parent7a3569f80051d48ac427849c30b2f5685b368b71 (diff)
cmake: check word size
Diffstat (limited to 'cmake/opentrack-word-size.cmake')
-rw-r--r--cmake/opentrack-word-size.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/opentrack-word-size.cmake b/cmake/opentrack-word-size.cmake
new file mode 100644
index 00000000..c670ed59
--- /dev/null
+++ b/cmake/opentrack-word-size.cmake
@@ -0,0 +1,12 @@
+include(CheckTypeSize)
+check_type_size(void* opentrack-word-size BUILTIN_TYPES_ONLY LANGUAGE C)
+message(STATUS "detected word size is ${opentrack-word-size}")
+if(opentrack-word-size LESS 4)
+ message(FATAL_ERROR "word size either misdetected or really less than 4")
+endif()
+set(opentrack-word-size ${opentrack-word-size})
+if(opentrack-word-size EQUAL 8)
+ set(opentrack-64bit TRUE)
+else()
+ set(opentrack-64bit FALSE)
+endif()