Loading cc/builder.go +8 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,14 @@ func transformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles, no cppflags += " ${config.NoOverrideGlobalCflags}" toolingCppflags += " ${config.NoOverrideGlobalCflags}" modulePath := android.PathForModuleSrc(ctx).String() if android.IsThirdPartyPath(modulePath) { cflags += " ${config.NoOverrideExternalGlobalCflags}" toolingCflags += " ${config.NoOverrideExternalGlobalCflags}" cppflags += " ${config.NoOverrideExternalGlobalCflags}" toolingCppflags += " ${config.NoOverrideExternalGlobalCflags}" } // Multiple source files have build rules usually share the same cFlags or tidyFlags. // Define only one version in this module and share it in multiple build rules. // To simplify the code, the shared variables are all named as $flags<nnn>. Loading cc/cc_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -4005,12 +4005,12 @@ func TestIncludeDirectoryOrdering(t *testing.T) { { name: "c", src: "foo.c", expected: combineSlices(baseExpectedFlags, conly, expectedIncludes, cflags, cstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}"}), expected: combineSlices(baseExpectedFlags, conly, expectedIncludes, cflags, cstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}), }, { name: "cc", src: "foo.cc", expected: combineSlices(baseExpectedFlags, cppOnly, expectedIncludes, cflags, cppstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}"}), expected: combineSlices(baseExpectedFlags, cppOnly, expectedIncludes, cflags, cppstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}), }, { name: "assemble", Loading cc/config/global.go +7 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,12 @@ var ( "-Wno-error=unused-but-set-parameter", // http://b/197240255 } noOverrideExternalGlobalCflags = []string{ // http://b/197240255 "-Wno-unused-but-set-variable", "-Wno-unused-but-set-parameter", } // Extra cflags for external third-party projects to disable warnings that // are infeasible to fix in all the external projects and their upstream repos. extraExternalCflags = []string{ Loading Loading @@ -346,6 +352,7 @@ func init() { exportStringListStaticVariable("HostGlobalCflags", hostGlobalCflags) exportStringListStaticVariable("NoOverrideGlobalCflags", noOverrideGlobalCflags) exportStringListStaticVariable("NoOverrideExternalGlobalCflags", noOverrideExternalGlobalCflags) exportStringListStaticVariable("CommonGlobalCppflags", commonGlobalCppflags) exportStringListStaticVariable("ExternalCflags", extraExternalCflags) Loading cc/makevars.go +1 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("CLANG_EXTERNAL_CFLAGS", "${config.ExternalCflags}") ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.NoOverrideGlobalCflags}") ctx.Strict("GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE", "") ctx.Strict("GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE", "${config.NoOverrideExternalGlobalCflags}") ctx.Strict("BOARD_VNDK_VERSION", ctx.DeviceConfig().VndkVersion()) ctx.Strict("RECOVERY_SNAPSHOT_VERSION", ctx.DeviceConfig().RecoverySnapshotVersion()) Loading Loading
cc/builder.go +8 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,14 @@ func transformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles, no cppflags += " ${config.NoOverrideGlobalCflags}" toolingCppflags += " ${config.NoOverrideGlobalCflags}" modulePath := android.PathForModuleSrc(ctx).String() if android.IsThirdPartyPath(modulePath) { cflags += " ${config.NoOverrideExternalGlobalCflags}" toolingCflags += " ${config.NoOverrideExternalGlobalCflags}" cppflags += " ${config.NoOverrideExternalGlobalCflags}" toolingCppflags += " ${config.NoOverrideExternalGlobalCflags}" } // Multiple source files have build rules usually share the same cFlags or tidyFlags. // Define only one version in this module and share it in multiple build rules. // To simplify the code, the shared variables are all named as $flags<nnn>. Loading
cc/cc_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -4005,12 +4005,12 @@ func TestIncludeDirectoryOrdering(t *testing.T) { { name: "c", src: "foo.c", expected: combineSlices(baseExpectedFlags, conly, expectedIncludes, cflags, cstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}"}), expected: combineSlices(baseExpectedFlags, conly, expectedIncludes, cflags, cstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}), }, { name: "cc", src: "foo.cc", expected: combineSlices(baseExpectedFlags, cppOnly, expectedIncludes, cflags, cppstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}"}), expected: combineSlices(baseExpectedFlags, cppOnly, expectedIncludes, cflags, cppstd, lastIncludes, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}), }, { name: "assemble", Loading
cc/config/global.go +7 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,12 @@ var ( "-Wno-error=unused-but-set-parameter", // http://b/197240255 } noOverrideExternalGlobalCflags = []string{ // http://b/197240255 "-Wno-unused-but-set-variable", "-Wno-unused-but-set-parameter", } // Extra cflags for external third-party projects to disable warnings that // are infeasible to fix in all the external projects and their upstream repos. extraExternalCflags = []string{ Loading Loading @@ -346,6 +352,7 @@ func init() { exportStringListStaticVariable("HostGlobalCflags", hostGlobalCflags) exportStringListStaticVariable("NoOverrideGlobalCflags", noOverrideGlobalCflags) exportStringListStaticVariable("NoOverrideExternalGlobalCflags", noOverrideExternalGlobalCflags) exportStringListStaticVariable("CommonGlobalCppflags", commonGlobalCppflags) exportStringListStaticVariable("ExternalCflags", extraExternalCflags) Loading
cc/makevars.go +1 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("CLANG_EXTERNAL_CFLAGS", "${config.ExternalCflags}") ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.NoOverrideGlobalCflags}") ctx.Strict("GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE", "") ctx.Strict("GLOBAL_CLANG_EXTERNAL_CFLAGS_NO_OVERRIDE", "${config.NoOverrideExternalGlobalCflags}") ctx.Strict("BOARD_VNDK_VERSION", ctx.DeviceConfig().VndkVersion()) ctx.Strict("RECOVERY_SNAPSHOT_VERSION", ctx.DeviceConfig().RecoverySnapshotVersion()) Loading