mirror of
https://github.com/nasa/trick.git
synced 2025-01-19 03:06:23 +00:00
trick-ICG fails when using clang < 3.4
The clang path created uses the patchlevel which prior to 3.4 was not used by clang. This resulted in a bad being created and eventually an llvm assertion error. Added a compiler ifdef so that the patchlevel is not used before 3.4 refs #65
This commit is contained in:
parent
8193b5de7b
commit
3577e72bce
@ -39,12 +39,16 @@ void HeaderSearchDirs::AddCompilerBuiltInSearchDirs () {
|
||||
std::stringstream icg_dir ;
|
||||
icg_dir << LLVM_HOME << "/lib/clang/" ;
|
||||
icg_dir << __clang_major__ << "." << __clang_minor__ ;
|
||||
#if (__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ >= 4))
|
||||
#ifdef __clang_patchlevel__
|
||||
icg_dir << "." << __clang_patchlevel__ ;
|
||||
#endif
|
||||
#endif
|
||||
icg_dir << "/include" ;
|
||||
char * resolved_path = realpath(icg_dir.str().c_str(), NULL ) ;
|
||||
hso.AddPath(resolved_path , clang::frontend::System, IsFramework, IsSysRootRelative);
|
||||
if ( resolved_path != NULL ) {
|
||||
hso.AddPath(resolved_path , clang::frontend::System, IsFramework, IsSysRootRelative);
|
||||
}
|
||||
#endif
|
||||
|
||||
fp = popen("${TRICK_HOME}/bin/trick-gte TRICK_CPPC" , "r") ;
|
||||
|
@ -4,7 +4,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
CC := $(shell $(LLVM_HOME)/bin/llvm-config --bindir)/clang
|
||||
CXX := $(shell $(LLVM_HOME)/bin/llvm-config --bindir)/clang++
|
||||
CXXFLAGS := -I$(shell $(LLVM_HOME)/bin/llvm-config --includedir) -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti
|
||||
CXXFLAGS := -g -I$(shell $(LLVM_HOME)/bin/llvm-config --includedir) -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti
|
||||
|
||||
CLANG_MINOR_GTEQ5 := $(shell expr `$(LLVM_HOME)/bin/llvm-config --version | cut -f2 -d. ` \>= 5 )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user