Set CMake ADDITIONAL_HEADER_DIRS on libraries with headers in /include. NFC.
In a UI such as XCode, it can group the headers for a library with that library.
This is done in the CMakeLists.txt for the library itself by setting the path(s)
as ADDITIONAL_HEADER_DIRS.
LLVM already does this for all of its libraries, so just adding this to lld to
make things easier. Should be NFC.
llvm-svn: 257002
diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index 5e2497d..7458de0 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -1,4 +1,5 @@
set(LLD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(LLD_INCLUDE_DIR ${LLD_SOURCE_DIR}/include )
set(LLD_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
# Compute the LLD version from the LLVM version.
diff --git a/lld/lib/Config/CMakeLists.txt b/lld/lib/Config/CMakeLists.txt
index 5bdcdc5..e971b0b 100644
--- a/lld/lib/Config/CMakeLists.txt
+++ b/lld/lib/Config/CMakeLists.txt
@@ -1,5 +1,9 @@
add_lld_library(lldConfig
Version.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${LLD_INCLUDE_DIR}/lld/Config
+
LINK_LIBS
LLVMSupport
)
diff --git a/lld/lib/Core/CMakeLists.txt b/lld/lib/Core/CMakeLists.txt
index 70e6f49..41e0e76 100644
--- a/lld/lib/Core/CMakeLists.txt
+++ b/lld/lib/Core/CMakeLists.txt
@@ -7,6 +7,10 @@
Resolver.cpp
SymbolTable.cpp
Writer.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${LLD_INCLUDE_DIR}/lld/Core
+
LINK_LIBS
LLVMSupport
)
diff --git a/lld/lib/Driver/CMakeLists.txt b/lld/lib/Driver/CMakeLists.txt
index 0d77c5d..519456a 100644
--- a/lld/lib/Driver/CMakeLists.txt
+++ b/lld/lib/Driver/CMakeLists.txt
@@ -14,6 +14,10 @@
Driver.cpp
GnuLdDriver.cpp
UniversalDriver.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${LLD_INCLUDE_DIR}/lld/Driver
+
LINK_LIBS
lldConfig
lldMachO
diff --git a/lld/lib/ReaderWriter/CMakeLists.txt b/lld/lib/ReaderWriter/CMakeLists.txt
index 970d6b2..2bb5655 100644
--- a/lld/lib/ReaderWriter/CMakeLists.txt
+++ b/lld/lib/ReaderWriter/CMakeLists.txt
@@ -10,6 +10,10 @@
CoreLinkingContext.cpp
FileArchive.cpp
LinkerScript.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${LLD_INCLUDE_DIR}/lld/ReaderWriter
+
LINK_LIBS
lldCore
lldYAML