aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-03-30 11:05:48 -0400
committerJames McCoy <jamessan@jamessan.com>2017-03-30 21:35:36 -0400
commitaf2ee9c5d1118bb51cd6b5c1e1edbda91648712d (patch)
tree07669f8a41725505e419b275d5ac3f1f0b9ec3e0
parentd92add8a4b00d5e87fd367ae2656ac5ba87a8f06 (diff)
downloadrneovim-af2ee9c5d1118bb51cd6b5c1e1edbda91648712d.tar.gz
rneovim-af2ee9c5d1118bb51cd6b5c1e1edbda91648712d.tar.bz2
rneovim-af2ee9c5d1118bb51cd6b5c1e1edbda91648712d.zip
cmake: Detect whether msgpack-c has MSGPACK_OBJECT_FLOAT{32,64} types
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a058f2bff..e8956c9074 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -310,6 +310,21 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
find_package(Msgpack 1.0.0 REQUIRED)
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
+list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
+check_c_source_compiles("
+#include <msgpack.h>
+
+int
+main(void)
+{
+ return MSGPACK_OBJECT_FLOAT32;
+}
+" MSGPACK_HAS_FLOAT32)
+
+if(MSGPACK_HAS_FLOAT32)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_MSGPACK_HAS_FLOAT32")
+endif()
+
if(UNIX)
option(FEAT_TUI "Enable the Terminal UI" ON)
else()