ICG fails to compile on Mac when using clang/llvm 3.8.1. #271

Modified the makefile to define LIBCLANG_MAJOR, LIBCLANG_MINOR, and
LIBCLANG_PATCHLEVEL based on the llvm-config executable in the llvm
directory pointed to by the configuration.  These new variable names
are independent of the __clang_major__, etc. variables we were defining
only in Linux.  Using these names, we can reduce the clang version
checks to a single consistent set of version numbers.  We don't have
to deal with the different version numbers assigned by Apple.
This commit is contained in:
Alex Lin
2016-07-25 14:57:07 -05:00
parent df94af17df
commit f7d1ff6376
4 changed files with 16 additions and 39 deletions

View File

@ -39,11 +39,9 @@ void HeaderSearchDirs::AddCompilerBuiltInSearchDirs () {
#if __linux
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
icg_dir << LIBCLANG_MAJOR << "." << LIBCLANG_MINOR ;
#ifdef LIBCLANG_PATCHLEVEL
icg_dir << "." << LIBCLANG_PATCHLEVEL ;
#endif
icg_dir << "/include" ;
char * resolved_path = realpath(icg_dir.str().c_str(), NULL ) ;