diff options
author | Colin Cross <ccross@android.com> | 2015-03-26 16:09:47 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-03-27 15:58:24 -0700 |
commit | 1f8f234c336bac2f6a0bf3bf935accbc3c28491e (patch) | |
tree | 6477d149fd5b4375ad756633676d50af5818e4f7 | |
parent | 4ae185c7ecf40ac0da03b884d9f6c0a19d53a332 (diff) | |
download | build_soong-1f8f234c336bac2f6a0bf3bf935accbc3c28491e.tar.gz build_soong-1f8f234c336bac2f6a0bf3bf935accbc3c28491e.tar.bz2 build_soong-1f8f234c336bac2f6a0bf3bf935accbc3c28491e.zip |
Support cc_test_host
Support cc_test_host for gtest tests compiled for the host.
Change-Id: I632d2c211075ba9391d934609f1bf368459397e1
-rw-r--r-- | androidmk/cmd/androidmk/android.go | 2 | ||||
-rw-r--r-- | androidmk/cmd/androidmk/androidmk.go | 3 | ||||
-rw-r--r-- | cc/cc.go | 21 | ||||
-rw-r--r-- | cmd/soong_build/main.go | 1 |
4 files changed, 21 insertions, 6 deletions
diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go index fa25a9f0..7fd9919d 100644 --- a/androidmk/cmd/androidmk/android.go +++ b/androidmk/cmd/androidmk/android.go @@ -13,6 +13,7 @@ const ( build_executable = "cc_binary" build_host_executable = "cc_binary_host" build_native_test = "cc_test" + build_host_native_test = "cc_test_host" build_prebuilt = "prebuilt" ) @@ -105,6 +106,7 @@ func androidScope() parser.Scope { globalScope.Set("BUILD_HOST_STATIC_LIBRARY", build_host_static_library) globalScope.Set("BUILD_HOST_SHARED_LIBRARY", build_host_shared_library) globalScope.Set("BUILD_NATIVE_TEST", build_native_test) + globalScope.Set("BUILD_HOST_NATIVE_TEST", build_host_native_test) globalScope.Set("BUILD_EXECUTABLE", build_executable) globalScope.Set("BUILD_PREBUILT", build_prebuilt) globalScope.SetFunc("my-dir", mydir) diff --git a/androidmk/cmd/androidmk/androidmk.go b/androidmk/cmd/androidmk/androidmk.go index 1c3a68b3..71e69acf 100644 --- a/androidmk/cmd/androidmk/androidmk.go +++ b/androidmk/cmd/androidmk/androidmk.go @@ -111,7 +111,8 @@ func main() { case build_shared_library, build_static_library, build_executable, build_host_executable, build_prebuilt, build_host_static_library, - build_host_shared_library, build_native_test: + build_host_shared_library, build_native_test, + build_host_native_test: handleModuleConditionals(file, directive, cond) makeModule(file, val) @@ -1214,10 +1214,11 @@ func (c *CCBinary) DepNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDe } func NewCCBinary(binary *CCBinary, module CCModuleType, - hod common.HostOrDeviceSupported) (blueprint.Module, []interface{}) { + hod common.HostOrDeviceSupported, props ...interface{}) (blueprint.Module, []interface{}) { + + props = append(props, &binary.BinaryProperties) - return newCCDynamic(&binary.ccLinked, module, hod, common.MultilibFirst, - &binary.BinaryProperties) + return newCCDynamic(&binary.ccLinked, module, hod, common.MultilibFirst, props...) } func CCBinaryFactory() (blueprint.Module, []interface{}) { @@ -1334,8 +1335,8 @@ func (c *ccTest) installModule(ctx common.AndroidModuleContext, flags CCFlags) { func CCTestFactory() (blueprint.Module, []interface{}) { module := &ccTest{} - return newCCDynamic(&module.ccLinked, module, common.HostAndDeviceSupported, - common.MultilibFirst, &module.BinaryProperties, &module.testProperties) + return NewCCBinary(&module.CCBinary, module, common.HostAndDeviceSupported, + &module.testProperties) } func TestPerSrcMutator(mctx blueprint.EarlyMutatorContext) { @@ -1409,6 +1410,16 @@ func CCBinaryHostFactory() (blueprint.Module, []interface{}) { } // +// Host Tests +// + +func CCTestHostFactory() (blueprint.Module, []interface{}) { + module := &ccTest{} + return NewCCBinary(&module.CCBinary, module, common.HostSupported, + &module.testProperties) +} + +// // Device libraries shipped with gcc // diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go index c1f8243a..23bcb561 100644 --- a/cmd/soong_build/main.go +++ b/cmd/soong_build/main.go @@ -54,6 +54,7 @@ func main() { ctx.RegisterModuleType("cc_library_host_static", cc.CCLibraryHostStaticFactory) ctx.RegisterModuleType("cc_library_host_shared", cc.CCLibraryHostSharedFactory) ctx.RegisterModuleType("cc_binary_host", cc.CCBinaryHostFactory) + ctx.RegisterModuleType("cc_test_host", cc.CCTestHostFactory) ctx.RegisterModuleType("gensrcs", genrule.GenSrcsFactory) |