forked from OSchip/llvm-project
Put compiler headers in <prefix>/lib/clang/1.0/include (vs
<prefix>/Headers, gross). llvm-svn: 65247
This commit is contained in:
parent
d44e80d7fc
commit
3283ff5088
|
@ -1090,14 +1090,21 @@ void InitializeIncludePaths(const char *Argv0, HeaderSearch &Headers,
|
|||
|
||||
Init.AddDefaultEnvVarPaths(Lang);
|
||||
|
||||
// Add the clang headers, which are relative to the clang driver.
|
||||
// Add the clang headers, which are relative to the clang binary.
|
||||
llvm::sys::Path MainExecutablePath =
|
||||
llvm::sys::Path::GetMainExecutable(Argv0,
|
||||
(void*)(intptr_t)InitializeIncludePaths);
|
||||
if (!MainExecutablePath.isEmpty()) {
|
||||
MainExecutablePath.eraseComponent(); // Remove /clang from foo/bin/clang
|
||||
MainExecutablePath.eraseComponent(); // Remove /bin from foo/bin
|
||||
MainExecutablePath.appendComponent("Headers"); // Get foo/Headers
|
||||
|
||||
// Get foo/lib/clang/1.0/include
|
||||
//
|
||||
// FIXME: Don't embed version here.
|
||||
MainExecutablePath.appendComponent("lib");
|
||||
MainExecutablePath.appendComponent("clang");
|
||||
MainExecutablePath.appendComponent("1.0");
|
||||
MainExecutablePath.appendComponent("include");
|
||||
|
||||
// We pass true to ignore sysroot so that we *always* look for clang headers
|
||||
// relative to our executable, never relative to -isysroot.
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
LEVEL = ../../../..
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/Headers
|
||||
# FIXME: Get version from a common place.
|
||||
HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/1.0/include
|
||||
|
||||
HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h))
|
||||
|
||||
|
@ -19,16 +20,12 @@ OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS))
|
|||
|
||||
$(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir
|
||||
$(Verb) cp $< $@
|
||||
@echo Copying $(notdir $<) to build dir
|
||||
|
||||
printit:
|
||||
echo $(OBJHEADERS)
|
||||
echo $(PROJ_SRC_DIR)
|
||||
|
||||
$(Echo) Copying $(notdir $<) to build dir
|
||||
|
||||
# Hook into the standard Makefile rules.
|
||||
all-local:: $(OBJHEADERS)
|
||||
|
||||
PROJ_headers := $(DESTDIR)$(PROJ_prefix)/Headers
|
||||
PROJ_headers := $(DESTDIR)$(PROJ_prefix)/lib/clang/1.0/include
|
||||
|
||||
INSTHEADERS := $(addprefix $(PROJ_headers)/, $(HEADERS))
|
||||
|
||||
|
@ -37,6 +34,7 @@ $(PROJ_headers):
|
|||
|
||||
$(INSTHEADERS): $(PROJ_headers)/%.h: $(HeaderDir)/%.h | $(PROJ_headers)
|
||||
$(Verb) $(DataInstall) $< $(PROJ_headers)
|
||||
$(Echo) Installing compiler include file: $(notdir $<)
|
||||
|
||||
install-local:: $(INSTHEADERS)
|
||||
|
||||
|
|
Loading…
Reference in New Issue