aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2024-03-12 14:00:29 -0400
committerGitHub <noreply@github.com>2024-03-12 14:00:29 -0400
commitdd0fc73bbed4fde9db093c8798601a25d290ad1f (patch)
treeb56879bf324235e92d718ba228d5c958a31f4b52 /src
parentcb46f6e467268edf917cc3617b4c024a66b256de (diff)
parent118fd8367c3953abb43800a7c1ea0bcc0221e9cd (diff)
downloadrneovim-dd0fc73bbed4fde9db093c8798601a25d290ad1f.tar.gz
rneovim-dd0fc73bbed4fde9db093c8798601a25d290ad1f.tar.bz2
rneovim-dd0fc73bbed4fde9db093c8798601a25d290ad1f.zip
Merge pull request #27808 from jamessan/gen_cflags-cleanup
Cleanup construction of command-lines for header generation
Diffstat (limited to 'src')
-rw-r--r--src/nvim/CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 047b22edcc..7e22203aba 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -450,20 +450,27 @@ endif()
#-------------------------------------------------------------------------------
get_target_property(prop main_lib INTERFACE_COMPILE_DEFINITIONS)
-foreach(gen_cdef ${prop})
- if(NOT ${gen_cdef} MATCHES "INCLUDE_GENERATED_DECLARATIONS")
- list(APPEND gen_cflags "-D${gen_cdef}")
- endif()
-endforeach()
+if(NOT "${prop}" STREQUAL "prop-NOTFOUND")
+ foreach(gen_cdef ${prop})
+ if(NOT ${gen_cdef} MATCHES "INCLUDE_GENERATED_DECLARATIONS")
+ list(APPEND gen_cflags "-D${gen_cdef}")
+ endif()
+ endforeach()
+endif()
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()
+ if(NOT "${prop}" STREQUAL "prop-NOTFOUND")
+ message(STATUS "${target} props '${prop}'")
+ foreach(gen_include ${prop})
+ list(APPEND gen_cflags "-I${gen_include}")
+ endforeach()
+ endif()
endforeach()
+list(REMOVE_DUPLICATES gen_cflags)
+
if(APPLE AND CMAKE_OSX_SYSROOT)
list(APPEND gen_cflags "-isysroot" "${CMAKE_OSX_SYSROOT}")
endif()