aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Szakmeister <jszakmeister@users.noreply.github.com>2017-03-17 04:14:56 -0400
committerJustin M. Keyes <justinkz@gmail.com>2017-03-17 09:14:56 +0100
commit694edc550463d607cf44ad13b084dc7cc3d0d75a (patch)
tree936e7ae299a9a61045d1cb7b45453c4360aefee2
parent27e1b2dce459ec9a79d6b81a342447363495f5a0 (diff)
downloadrneovim-694edc550463d607cf44ad13b084dc7cc3d0d75a.tar.gz
rneovim-694edc550463d607cf44ad13b084dc7cc3d0d75a.tar.bz2
rneovim-694edc550463d607cf44ad13b084dc7cc3d0d75a.zip
test: fix the unit test build on macOS Sierra (#6300)
We need to add the SDK includes to the preprocessing step, otherwise it will fail to resolve the system includes such as sys/stat.h and fcntl.h.
-rw-r--r--test/includes/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/includes/CMakeLists.txt b/test/includes/CMakeLists.txt
index 3d85197f19..305d3369b7 100644
--- a/test/includes/CMakeLists.txt
+++ b/test/includes/CMakeLists.txt
@@ -1,5 +1,12 @@
file(GLOB_RECURSE PRE_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} pre/*.h)
+# We need to add the SDK directories on OS X, and perhaps other operating
+# systems.
+set(gen_cflags)
+foreach(gen_include ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
+ list(APPEND gen_cflags ${CMAKE_INCLUDE_FLAG_C}${gen_include})
+endforeach()
+
foreach(hfile ${PRE_HEADERS})
string(REGEX REPLACE ^pre/ post/ post_hfile ${hfile})
get_filename_component(hdir ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile} PATH)
@@ -8,6 +15,7 @@ foreach(hfile ${PRE_HEADERS})
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile}
COMMAND ${CMAKE_C_COMPILER} -std=c99 -E -P
${CMAKE_CURRENT_SOURCE_DIR}/${hfile}
+ ${gen_cflags}
-I${LIBUV_INCLUDE_DIRS}
-o ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile})
list(APPEND POST_HEADERS ${post_hfile})