From ec95acda33a8eb20d2ef9275c3535773b9332729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20P=C3=B6chtrager?= Date: Tue, 29 Mar 2016 20:20:11 +0200 Subject: [PATCH] Wrapper: Remove unneeded '-fcolor-diagnostics' There is something wrong with the pre-built binaries from llvm.org. Colored warnings still work properly when building Clang/LLVM from source. --- wrapper/main.cpp | 7 ------- wrapper/target.cpp | 10 ++-------- wrapper/target.h | 1 - 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/wrapper/main.cpp b/wrapper/main.cpp index 0d17c31..e2dba8c 100644 --- a/wrapper/main.cpp +++ b/wrapper/main.cpp @@ -183,11 +183,6 @@ bool runprog(Target &target, const char *, const char *progname, char **cargs) { (*prog)(args.size() - 1, args.data(), target); } -bool colordiagnostics(Target &target, const char *opt, const char *, char **) { - target.colordiagnostics = !strcmp(opt, "-fcolor-diagnostics"); - return true; -} - bool liblto(Target &target, const char *opt, const char *, char **) { target.wliblto = !strcmp(opt, "-Wliblto"); return true; @@ -257,8 +252,6 @@ constexpr struct Opt { {"-x", language, true, true}, {"-foc-use-gcc-libstdc++", usegcclibstdcxx}, {"-foc-run-prog", runprog, true, false, "="}, // for internal use only - {"-fcolor-diagnostics", colordiagnostics, false, true}, - {"-fno-color-diagnostics", colordiagnostics, false, true}, {"-Wliblto", liblto, false, true}, {"-Wno-liblto", liblto, false, true}, {"-isystem", checkincludepath, true, true}, diff --git a/wrapper/target.cpp b/wrapper/target.cpp index e07872e..e14ddeb 100644 --- a/wrapper/target.cpp +++ b/wrapper/target.cpp @@ -43,8 +43,7 @@ namespace target { Target::Target() : vendor(getDefaultVendor()), SDK(getenv("OSXCROSS_SDKROOT")), arch(Arch::x86_64), target(getDefaultTarget()), stdlib(StdLib::unset), - usegcclibs(), colordiagnostics(-1), wliblto(-1), - compiler(getDefaultCompilerIdentifier()), + usegcclibs(), wliblto(-1), compiler(getDefaultCompilerIdentifier()), compilername(getDefaultCompilerName()), language() { if (!getExecutablePath(execpath, sizeof(execpath))) abort(); @@ -786,7 +785,7 @@ bool Target::setup() { } } - if (clangversion >= ClangVersion(3, 8)) { + if (isClang() && clangversion >= ClangVersion(3, 8)) { // // Silence: // warning: libLTO.dylib relative to clang installed dir not found; @@ -797,11 +796,6 @@ bool Target::setup() { // if (wliblto == -1) fargs.push_back("-Wno-liblto"); - // - // Get back color diagnostics. - // - if (colordiagnostics == -1) - fargs.push_back("-fcolor-diagnostics"); } return true; diff --git a/wrapper/target.h b/wrapper/target.h index f4ed7c1..9c96679 100644 --- a/wrapper/target.h +++ b/wrapper/target.h @@ -138,7 +138,6 @@ struct Target { ClangVersion clangversion; GCCVersion gccversion; bool usegcclibs; - int colordiagnostics; int wliblto; Compiler compiler; std::string compilerpath; // /usr/bin/clang | [...]/target/bin/*-gcc