summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-word-size.cmake
diff options
context:
space:
mode:
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()