From 17b21eae52c83b92e80d8de757185c3d27de49d6 Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Mon, 22 Jan 2018 05:26:51 -0500 Subject: build: fix creating generated files on macOS For some reason, using the clang executable inside of the Xcode default toolchain the platform's sysroot include isn't present. This was debugged by adding "-###" on the command line for generating the header for nvim/os/lang.c and is was evident the flag was missing. --- src/nvim/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 7eb1afa135..b14f93f90a 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -14,6 +14,7 @@ if(WIN32) # tell MinGW compiler to enable wmain set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -municode") elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -iframework CoreFoundation") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework CoreFoundation") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -framework CoreFoundation") endif() @@ -187,6 +188,10 @@ get_directory_property(gen_includes INCLUDE_DIRECTORIES) foreach(gen_include ${gen_includes} ${LUA_PREFERRED_INCLUDE_DIRS}) list(APPEND gen_cflags "-I${gen_include}") endforeach() +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT) + list(APPEND gen_cflags "-isysroot") + list(APPEND gen_cflags "${CMAKE_OSX_SYSROOT}") +endif() string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) separate_arguments(C_FLAGS_ARRAY UNIX_COMMAND ${CMAKE_C_FLAGS}) separate_arguments(C_FLAGS_${build_type}_ARRAY UNIX_COMMAND ${CMAKE_C_FLAGS_${build_type}}) -- cgit