Remove GCC checks

Clang is always used now, so we can remove all the GCC checks. Removing
GCC-specific configuration will happen in the next CL.

Test: m
Change-Id: I4835ecf6062159315d0dfb07b098e60bff033a8a
This commit is contained in:
Dan Willemsen
2018-10-07 20:54:34 -07:00
parent 230e4c77a5
commit 8536d6b3b7
15 changed files with 63 additions and 208 deletions

View File

@@ -18,7 +18,6 @@ import (
"fmt"
"android/soong/android"
"android/soong/cc/config"
"os"
"path"
"path/filepath"
@@ -150,18 +149,10 @@ func generateCLionProject(compiledModule CompiledInterface, ctx android.Singleto
f.WriteString(fmt.Sprintf("project(%s)\n", ccModule.ModuleBase.Name()))
f.WriteString(fmt.Sprintf("set(ANDROID_ROOT %s)\n\n", getAndroidSrcRootDirectory(ctx)))
if ccModule.flags.Clang {
pathToCC, _ := evalVariable(ctx, "${config.ClangBin}/")
f.WriteString(fmt.Sprintf("set(CMAKE_C_COMPILER \"%s%s\")\n", buildCMakePath(pathToCC), "clang"))
f.WriteString(fmt.Sprintf("set(CMAKE_CXX_COMPILER \"%s%s\")\n", buildCMakePath(pathToCC), "clang++"))
} else {
toolchain := config.FindToolchain(ccModule.Os(), ccModule.Arch())
root, _ := evalVariable(ctx, toolchain.GccRoot())
triple, _ := evalVariable(ctx, toolchain.GccTriple())
pathToCC := filepath.Join(root, "bin", triple+"-")
f.WriteString(fmt.Sprintf("set(CMAKE_C_COMPILER \"%s%s\")\n", buildCMakePath(pathToCC), "gcc"))
f.WriteString(fmt.Sprintf("set(CMAKE_CXX_COMPILER \"%s%s\")\n", buildCMakePath(pathToCC), "g++"))
}
pathToCC, _ := evalVariable(ctx, "${config.ClangBin}/")
f.WriteString(fmt.Sprintf("set(CMAKE_C_COMPILER \"%s%s\")\n", buildCMakePath(pathToCC), "clang"))
f.WriteString(fmt.Sprintf("set(CMAKE_CXX_COMPILER \"%s%s\")\n", buildCMakePath(pathToCC), "clang++"))
// Add all sources to the project.
f.WriteString("list(APPEND\n")
f.WriteString(" SOURCE_FILES\n")