Combine include path -D; pass src and obj for LLVMDEV/ROOT; remove unused -Ds
This commit is contained in:
parent
069a9d76c1
commit
b62b5d7937
@ -142,8 +142,7 @@ endif
|
||||
|
||||
##### extra rules ######
|
||||
ifneq ($(LLVMDEV),)
|
||||
$(CLINGO) : CLINGCXXFLAGS += '-DCLING_SRCDIR_INCL="$(CLINGDIR)/include"' \
|
||||
'-DCLING_INSTDIR_INCL="$(shell cd $(LLVMDIRI); pwd)/include"'
|
||||
$(CLINGO) : CLINGCXXFLAGS += '-DCLING_INCLUDE_PATHS="$(CLINGDIR)/include:$(shell pwd)/$(LLVMDIRO)/include:$(shell pwd)/$(LLVMDIRO)/tools/clang/include:$(LLVMDIRS)/include:$(LLVMDIRS)/tools/clang/include"'
|
||||
$(CLINGEXEO): CLINGCXXFLAGS += -I$(TEXTINPUTDIRS)
|
||||
$(CLINGEXEO): CLINGEXCCXXFLAGS := -fexceptions
|
||||
else
|
||||
|
@ -180,14 +180,18 @@ namespace cling {
|
||||
|
||||
m_IncrParser->Initialize();
|
||||
|
||||
// Add path to interpreter's include files
|
||||
// Try to find the headers in the src folder first
|
||||
#ifdef CLING_SRCDIR_INCL
|
||||
llvm::StringRef SrcIncl(CLING_SRCDIR_INCL);
|
||||
if (llvm::sys::fs::is_directory(SrcIncl))
|
||||
AddIncludePath(SrcIncl);
|
||||
#endif
|
||||
|
||||
// Add configuration paths to interpreter's include files.
|
||||
#ifdef CLING_INCLUDE_PATHS
|
||||
llvm::StringRef InclPaths(CLING_INCLUDE_PATHS);
|
||||
for (std::pair<llvm::StringRef, llvm::StringRef> Split = InclPaths.split(':');
|
||||
!Split.second.empty(); Split = InclPaths.split(':')) {
|
||||
if (llvm::sys::fs::is_directory(Split.first))
|
||||
AddIncludePath(Split.first);
|
||||
InclPaths = Split.second;
|
||||
}
|
||||
// Add remaining part
|
||||
AddIncludePath(InclPaths);
|
||||
#else
|
||||
llvm::SmallString<512> P(GetExecutablePath(argv[0]));
|
||||
if (!P.empty()) {
|
||||
// Remove /cling from foo/bin/clang
|
||||
@ -200,14 +204,8 @@ namespace cling {
|
||||
llvm::sys::path::append(P, "include");
|
||||
if (llvm::sys::fs::is_directory(P.str()))
|
||||
AddIncludePath(P.str());
|
||||
else {
|
||||
#ifdef CLING_INSTDIR_INCL
|
||||
llvm::StringRef InstIncl(CLING_INSTDIR_INCL);
|
||||
if (llvm::sys::fs::is_directory(InstIncl))
|
||||
AddIncludePath(InstIncl);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Enable incremental processing, which prevents the preprocessor destroying
|
||||
// the lexer on EOF token.
|
||||
|
@ -20,9 +20,7 @@ CXXFLAGS = -fno-rtti
|
||||
CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_SRC_DIR)/../../../clang/include \
|
||||
-I$(PROJ_SRC_DIR)/../../../clang/lib -I$(PROJ_OBJ_DIR)/../../include \
|
||||
-I$(PROJ_OBJ_DIR)/../../../clang/include \
|
||||
'-DCLANG_SYS_HEADERS="-I$(PROJ_SRC_DIR)../../../clang/lib/Headers"' \
|
||||
'-DCLING_INSTDIR_INCL="$(DESTDIR)$(PROJ_includedir)"' \
|
||||
'-DCLING_SRCDIR_INCL="$(LLVM_SRC_ROOT)/tools/cling/include"'
|
||||
'-DCLING_INCLUDE_PATHS="$(DESTDIR)$(PROJ_includedir):$(LLVM_SRC_ROOT)/tools/cling/include:$(LLVM_SRC_ROOT)/tools/clang/include:$(LLVM_SRC_ROOT)/include"'
|
||||
|
||||
include $(CLING_LEVEL)/Makefile
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user