From af2ee9c5d1118bb51cd6b5c1e1edbda91648712d Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 30 Mar 2017 11:05:48 -0400 Subject: [PATCH] cmake: Detect whether msgpack-c has MSGPACK_OBJECT_FLOAT{32,64} types --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 + +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()