Merge "Add java_test_helper_library"
diff --git a/cc/binary.go b/cc/binary.go
index 7f7c600..60ef2ce 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -57,13 +57,13 @@
android.RegisterModuleType("cc_binary_host", binaryHostFactory)
}
-// Module factory for binaries
+// cc_binary produces a binary that is runnable on a device.
func BinaryFactory() android.Module {
module, _ := NewBinary(android.HostAndDeviceSupported)
return module.Init()
}
-// Module factory for host binaries
+// cc_binary_host produces a binary that is runnable on a host.
func binaryHostFactory() android.Module {
module, _ := NewBinary(android.HostSupported)
return module.Init()
diff --git a/cc/cc.go b/cc/cc.go
index c80d00c..a7f1417 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1966,6 +1966,11 @@
func (*Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
+// cc_defaults provides a set of properties that can be inherited by other cc
+// modules. A module can use the properties from a cc_defaults using
+// `defaults: ["<:default_module_name>"]`. Properties of both modules are
+// merged (when possible) by prepending the default module's values to the
+// depending module's values.
func defaultsFactory() android.Module {
return DefaultsFactory()
}
diff --git a/cc/lto.go b/cc/lto.go
index 0d7a246..1084869 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -91,22 +91,22 @@
flags.CFlags = append(flags.CFlags, ltoFlag)
flags.LdFlags = append(flags.LdFlags, ltoFlag)
- if ctx.Config().IsEnvTrue("USE_THINLTO_CACHE") && Bool(lto.Properties.Lto.Thin) && !lto.useClangLld(ctx) {
+ if ctx.Config().IsEnvTrue("USE_THINLTO_CACHE") && Bool(lto.Properties.Lto.Thin) && lto.useClangLld(ctx) {
// Set appropriate ThinLTO cache policy
- cacheDirFormat := "-Wl,-plugin-opt,cache-dir="
+ cacheDirFormat := "-Wl,--thinlto-cache-dir="
cacheDir := android.PathForOutput(ctx, "thinlto-cache").String()
flags.LdFlags = append(flags.LdFlags, cacheDirFormat+cacheDir)
// Limit the size of the ThinLTO cache to the lesser of 10% of available
// disk space and 10GB.
- cachePolicyFormat := "-Wl,-plugin-opt,cache-policy="
+ cachePolicyFormat := "-Wl,--thinlto-cache-policy="
policy := "cache_size=10%:cache_size_bytes=10g"
flags.LdFlags = append(flags.LdFlags, cachePolicyFormat+policy)
}
// If the module does not have a profile, be conservative and do not inline
// or unroll loops during LTO, in order to prevent significant size bloat.
- if !ctx.isPgoCompile() && !lto.useClangLld(ctx) {
+ if !ctx.isPgoCompile() {
flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-inline-threshold=0")
flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-unroll-threshold=0")
}
diff --git a/cc/stl.go b/cc/stl.go
index 5e61e1e..e59f677 100644
--- a/cc/stl.go
+++ b/cc/stl.go
@@ -66,7 +66,7 @@
}
if ctx.useSdk() && ctx.Device() {
switch s {
- case "":
+ case "", "system":
return "ndk_system"
case "c++_shared", "c++_static":
return "ndk_lib" + s
diff --git a/cc/test.go b/cc/test.go
index 045cc4f..dae2a37 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -74,31 +74,41 @@
android.RegisterModuleType("cc_benchmark_host", BenchmarkHostFactory)
}
-// Module factory for tests
+// cc_test generates a test config file and an executable binary file to test
+// specific functionality on a device. The executable binary gets an implicit
+// static_libs dependency on libgtests unless the gtest flag is set to false.
func TestFactory() android.Module {
module := NewTest(android.HostAndDeviceSupported)
return module.Init()
}
-// Module factory for test libraries
+// cc_test_library creates an archive of files (i.e. .o files) which is later
+// referenced by another module (such as cc_test, cc_defaults or cc_test_library)
+// for archiving or linking.
func TestLibraryFactory() android.Module {
module := NewTestLibrary(android.HostAndDeviceSupported)
return module.Init()
}
-// Module factory for benchmarks
+// cc_benchmark compiles an executable binary that performs benchmark testing
+// of a specific component in a device. Additional files such as test suites
+// and test configuration are installed on the side of the compiled executed
+// binary.
func BenchmarkFactory() android.Module {
module := NewBenchmark(android.HostAndDeviceSupported)
return module.Init()
}
-// Module factory for host tests
+// cc_test_host compiles a test host binary.
func TestHostFactory() android.Module {
module := NewTest(android.HostSupported)
return module.Init()
}
-// Module factory for host benchmarks
+// cc_benchmark_host compiles an executable binary that performs benchmark
+// testing of a specific component in the host. Additional files such as
+// test suites and test configuration are installed on the side of the
+// compiled executed binary.
func BenchmarkHostFactory() android.Module {
module := NewBenchmark(android.HostSupported)
return module.Init()