diff options
author | James McCoy <jamessan@jamessan.com> | 2018-07-10 23:16:13 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2018-07-11 00:26:28 -0400 |
commit | 9f8bd77d7b62b8f642fd8a8d3fd3a73b183cfdf4 (patch) | |
tree | c604c0f3c00da49f3b4e8632d4b989c946e3ab29 /test/includes | |
parent | ba7704ab4ea6186f0a3090b930a4be7e3aa9857c (diff) | |
download | rneovim-9f8bd77d7b62b8f642fd8a8d3fd3a73b183cfdf4.tar.gz rneovim-9f8bd77d7b62b8f642fd8a8d3fd3a73b183cfdf4.tar.bz2 rneovim-9f8bd77d7b62b8f642fd8a8d3fd3a73b183cfdf4.zip |
test/includes: Use ${gen_cdefs} when pre-processing headers
Now that uv.h is directly being included, pre-processing of
test/includes/pre/uv.h fails on Linux with
In file included from «SRCDIR»/neovim/test/includes/pre/uv.h:1:
In file included from /usr/include/uv.h:62:
/usr/include/uv/unix.h:72:11: fatal error: 'uv/pthread-barrier.h' file not found
# include "uv/pthread-barrier.h"
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
This happens because we're missing -D_GNU_SOURCE (part of ${gen_cdefs}),
which makes the pthread_barrier_* functionality visible.
Diffstat (limited to 'test/includes')
-rw-r--r-- | test/includes/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/includes/CMakeLists.txt b/test/includes/CMakeLists.txt index 2846df0e37..4d7e962fbd 100644 --- a/test/includes/CMakeLists.txt +++ b/test/includes/CMakeLists.txt @@ -7,6 +7,13 @@ foreach(gen_include ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}) list(APPEND gen_cflags ${CMAKE_INCLUDE_FLAG_C}${gen_include}) endforeach() +get_directory_property(gen_cdefs COMPILE_DEFINITIONS) +foreach(gen_cdef ${gen_cdefs}) + if(NOT ${gen_cdef} MATCHES "INCLUDE_GENERATED_DECLARATIONS") + list(APPEND gen_cflags "-D${gen_cdef}") + endif() +endforeach() + foreach(hfile ${PRE_HEADERS}) string(REGEX REPLACE ^pre/ post/ post_hfile ${hfile}) get_filename_component(hdir ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile} PATH) |