diff options
author | Colin Cross <ccross@android.com> | 2015-04-22 13:07:53 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-04-22 14:08:45 -0700 |
commit | 28344528cf440442acd79894b7f4cfabb7a7bb46 (patch) | |
tree | cd9ab51ac0a877cd8c2159be971dbc2e14dfcad8 /cc/builder.go | |
parent | 56b4d45341e0235d95ffab75a26795cb490dbc60 (diff) | |
download | build_soong-28344528cf440442acd79894b7f4cfabb7a7bb46.tar.gz build_soong-28344528cf440442acd79894b7f4cfabb7a7bb46.tar.bz2 build_soong-28344528cf440442acd79894b7f4cfabb7a7bb46.zip |
Simplify flags in c compiling, fix NDK build warnings
Reduce the number of flags variables when compiling C by getting
rid of the separately-tracked IncludeDirs variables, and putting
them directly in GlobalFlags. Also changes exportedIncludeDirs
to exportedFlags, which will allow exporting flags besides -I.
Also fixes a bug when building a module with the NDK and -Werror
by passing NDK exported include directories with -isystem instead
of -I, which will ignore warnings from those includes.
Also fixes a bug where the default includes were being inserted
into all cflags by the arm and arm64 toolchain modules.
Change-Id: Ice97f84e637b21d20c38c85b881afa315f9f92ae
Diffstat (limited to 'cc/builder.go')
-rw-r--r-- | cc/builder.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/cc/builder.go b/cc/builder.go index ccf04f24..721d478a 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -40,20 +40,20 @@ var ( blueprint.RuleParams{ Depfile: "${out}.d", Deps: blueprint.DepsGCC, - Command: "$ccCmd $incFlags -c $cFlags -MD -MF ${out}.d -o $out $in", + Command: "$ccCmd -c $cFlags -MD -MF ${out}.d -o $out $in", Description: "cc $out", }, - "ccCmd", "incFlags", "cFlags") + "ccCmd", "cFlags") ld = pctx.StaticRule("ld", blueprint.RuleParams{ Command: "$ldCmd ${ldDirFlags} ${crtBegin} @${out}.rsp " + - "${libFlags} ${crtEnd} -o ${out} ${ldFlags} ${ldLibs}", + "${libFlags} ${crtEnd} -o ${out} ${ldFlags}", Description: "ld $out", Rspfile: "${out}.rsp", RspfileContent: "${in}", }, - "ldCmd", "ldDirFlags", "crtBegin", "libFlags", "crtEnd", "ldFlags", "ldLibs") + "ldCmd", "ldDirFlags", "crtBegin", "libFlags", "crtEnd", "ldFlags") partialLd = pctx.StaticRule("partialLd", blueprint.RuleParams{ @@ -97,8 +97,6 @@ type builderFlags struct { conlyFlags string cppFlags string ldFlags string - ldLibs string - incFlags string yaccFlags string nocrt bool toolchain Toolchain @@ -180,9 +178,8 @@ func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFil Inputs: []string{srcFile}, Implicits: deps, Args: map[string]string{ - "cFlags": moduleCflags, - "incFlags": flags.incFlags, - "ccCmd": ccCmd, + "cFlags": moduleCflags, + "ccCmd": ccCmd, }, }) } @@ -275,7 +272,6 @@ func TransformObjToDynamicBinary(ctx common.AndroidModuleContext, "libFlags": strings.Join(libFlagsList, " "), "ldFlags": flags.ldFlags, "crtEnd": crtEnd, - "ldLibs": flags.ldLibs, }, }) } |