diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index f15a255ec5..efa6b3620a 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -407,11 +407,14 @@ foreach(gen_cdef DO_NOT_DEFINE_EMPTY_ATTRIBUTES ${prop}) endif() endforeach() -get_target_property(prop main_lib INTERFACE_INCLUDE_DIRECTORIES) -foreach(gen_include ${prop}) - list(APPEND gen_cflags "-I${gen_include}") +get_directory_property(targets BUILDSYSTEM_TARGETS) +foreach(target ${targets}) + get_target_property(prop ${target} INTERFACE_INCLUDE_DIRECTORIES) + foreach(gen_include ${prop}) + list(APPEND gen_cflags "-I${gen_include}") + endforeach() endforeach() -list(APPEND gen_cflags "-I${DEPS_PREFIX}/include") + if(APPLE AND CMAKE_OSX_SYSROOT) list(APPEND gen_cflags "-isysroot") list(APPEND gen_cflags "${CMAKE_OSX_SYSROOT}")