|
@@ -450,7 +450,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
|
|
"${config.CommonGlobalCflags}",
|
|
|
fmt.Sprintf("${config.%sGlobalCflags}", hod))
|
|
|
|
|
|
- if isThirdParty(modulePath) {
|
|
|
+ if android.IsThirdPartyPath(modulePath) {
|
|
|
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "${config.ExternalCflags}")
|
|
|
}
|
|
|
|
|
@@ -675,28 +675,6 @@ func compileObjs(ctx android.ModuleContext, flags builderFlags,
|
|
|
return transformSourceToObj(ctx, subdir, srcFiles, flags, pathDeps, cFlagsDeps)
|
|
|
}
|
|
|
|
|
|
-var thirdPartyDirPrefixExceptions = []*regexp.Regexp{
|
|
|
- regexp.MustCompile("^vendor/[^/]*google[^/]*/"),
|
|
|
- regexp.MustCompile("^hardware/google/"),
|
|
|
- regexp.MustCompile("^hardware/interfaces/"),
|
|
|
- regexp.MustCompile("^hardware/libhardware[^/]*/"),
|
|
|
- regexp.MustCompile("^hardware/ril/"),
|
|
|
-}
|
|
|
-
|
|
|
-func isThirdParty(path string) bool {
|
|
|
- thirdPartyDirPrefixes := []string{"external/", "vendor/", "hardware/"}
|
|
|
-
|
|
|
- if android.HasAnyPrefix(path, thirdPartyDirPrefixes) {
|
|
|
- for _, prefix := range thirdPartyDirPrefixExceptions {
|
|
|
- if prefix.MatchString(path) {
|
|
|
- return false
|
|
|
- }
|
|
|
- }
|
|
|
- return true
|
|
|
- }
|
|
|
- return false
|
|
|
-}
|
|
|
-
|
|
|
// Properties for rust_bindgen related to generating rust bindings.
|
|
|
// This exists here so these properties can be included in a cc_default
|
|
|
// which can be used in both cc and rust modules.
|