aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-08-29 15:53:15 -0700
committerDan Willemsen <dwillemsen@google.com>2016-08-29 16:02:05 -0700
commit1d577e25a7aa7a761bd8fcbc6ea9ca349a8f4704 (patch)
tree6aff0d34142403adfa03b774b9e2a13537546936
parent15690c02d64088716c6e8cec963819f2cd997593 (diff)
downloadbuild_soong-1d577e25a7aa7a761bd8fcbc6ea9ca349a8f4704.tar.gz
build_soong-1d577e25a7aa7a761bd8fcbc6ea9ca349a8f4704.tar.bz2
build_soong-1d577e25a7aa7a761bd8fcbc6ea9ca349a8f4704.zip
Expose module suffixes to Make
These had only been exposed for shared libraries. Also fixes testDecorator to not have two baseInstallers both being written out to the Android.mk. Bug: 31158868 Test: manual diff of out/soong/Android-aosp_flounder.mk Test: Verify installed windows binaries end in .exe Change-Id: I2bded5fb090117d48ade575b4438e0dedd2e3763
-rw-r--r--cc/androidmk.go6
-rw-r--r--cc/test.go18
2 files changed, 10 insertions, 14 deletions
diff --git a/cc/androidmk.go b/cc/androidmk.go
index d4965d8d..831c0fbc 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -100,8 +100,7 @@ func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.An
fmt.Fprintln(w, "LOCAL_EXPORT_C_INCLUDE_DIRS :=", strings.Join(exportedIncludes, " "))
}
- fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := "+outputFile.Ext())
- fmt.Fprintln(w, "LOCAL_BUILT_MODULE_STEM := $(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX)")
+ fmt.Fprintln(w, "LOCAL_BUILT_MODULE_STEM := $(LOCAL_MODULE)"+outputFile.Ext())
fmt.Fprintln(w, "LOCAL_SYSTEM_SHARED_LIBRARIES :=")
@@ -141,12 +140,10 @@ func (binary *binaryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.Andr
func (benchmark *benchmarkDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
ctx.subAndroidMk(ret, benchmark.binaryDecorator)
- ctx.subAndroidMk(ret, benchmark.baseInstaller)
}
func (test *testBinary) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
ctx.subAndroidMk(ret, test.binaryDecorator)
- ctx.subAndroidMk(ret, test.baseInstaller)
if Bool(test.Properties.Test_per_src) {
ret.SubName = "_" + test.binaryDecorator.Properties.Stem
}
@@ -191,6 +188,7 @@ func (installer *baseInstaller) AndroidMk(ctx AndroidMkContext, ret *android.And
path := installer.path.RelPathString()
dir, file := filepath.Split(path)
stem := strings.TrimSuffix(file, filepath.Ext(file))
+ fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := "+filepath.Ext(file))
fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(OUT_DIR)/"+filepath.Clean(dir))
fmt.Fprintln(w, "LOCAL_MODULE_STEM := "+stem)
if len(installer.Properties.Symlinks) > 0 {
diff --git a/cc/test.go b/cc/test.go
index 6ffa178b..27b45d75 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -181,7 +181,6 @@ type testBinary struct {
testDecorator
*binaryDecorator
*baseCompiler
- *baseInstaller
Properties TestBinaryProperties
}
@@ -209,14 +208,15 @@ func (test *testBinary) linkerFlags(ctx ModuleContext, flags Flags) Flags {
}
func (test *testBinary) install(ctx ModuleContext, file android.Path) {
- test.baseInstaller.dir = filepath.Join("nativetest", ctx.ModuleName())
- test.baseInstaller.dir64 = filepath.Join("nativetest64", ctx.ModuleName())
- test.baseInstaller.install(ctx, file)
+ test.binaryDecorator.baseInstaller.dir = filepath.Join("nativetest", ctx.ModuleName())
+ test.binaryDecorator.baseInstaller.dir64 = filepath.Join("nativetest64", ctx.ModuleName())
+ test.binaryDecorator.baseInstaller.install(ctx, file)
}
func NewTest(hod android.HostOrDeviceSupported) *Module {
module, binary := NewBinary(hod)
module.multilib = android.MultilibBoth
+ binary.baseInstaller = NewTestInstaller()
test := &testBinary{
testDecorator: testDecorator{
@@ -224,7 +224,6 @@ func NewTest(hod android.HostOrDeviceSupported) *Module {
},
binaryDecorator: binary,
baseCompiler: NewBaseCompiler(),
- baseInstaller: NewTestInstaller(),
}
test.testDecorator.Properties.Gtest = true
module.compiler = test
@@ -275,7 +274,6 @@ func NewTestLibrary(hod android.HostOrDeviceSupported) *Module {
type benchmarkDecorator struct {
*binaryDecorator
- *baseInstaller
}
func (benchmark *benchmarkDecorator) linkerInit(ctx BaseModuleContext) {
@@ -294,18 +292,18 @@ func (benchmark *benchmarkDecorator) linkerDeps(ctx BaseModuleContext, deps Deps
}
func (benchmark *benchmarkDecorator) install(ctx ModuleContext, file android.Path) {
- benchmark.baseInstaller.dir = filepath.Join("nativetest", ctx.ModuleName())
- benchmark.baseInstaller.dir64 = filepath.Join("nativetest64", ctx.ModuleName())
- benchmark.baseInstaller.install(ctx, file)
+ benchmark.binaryDecorator.baseInstaller.dir = filepath.Join("nativetest", ctx.ModuleName())
+ benchmark.binaryDecorator.baseInstaller.dir64 = filepath.Join("nativetest64", ctx.ModuleName())
+ benchmark.binaryDecorator.baseInstaller.install(ctx, file)
}
func NewBenchmark(hod android.HostOrDeviceSupported) *Module {
module, binary := NewBinary(hod)
module.multilib = android.MultilibBoth
+ binary.baseInstaller = NewTestInstaller()
benchmark := &benchmarkDecorator{
binaryDecorator: binary,
- baseInstaller: NewTestInstaller(),
}
module.linker = benchmark
module.installer = benchmark