Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f67c42d authored by Jaewoong Jung's avatar Jaewoong Jung Committed by Gerrit Code Review
Browse files

Merge "android_app stl property bug fix"

parents ac1d2673 710756a6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import (
func init() {
	android.RegisterModuleType("ndk_prebuilt_object", ndkPrebuiltObjectFactory)
	android.RegisterModuleType("ndk_prebuilt_static_stl", ndkPrebuiltStaticStlFactory)
	android.RegisterModuleType("ndk_prebuilt_shared_stl", ndkPrebuiltSharedStlFactory)
	android.RegisterModuleType("ndk_prebuilt_shared_stl", NdkPrebuiltSharedStlFactory)
}

// NDK prebuilt libraries.
@@ -107,7 +107,7 @@ func (*ndkPrebuiltStlLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
// library (stl) library for linking operation. The soong's module name format
// is ndk_<NAME>.so where the library is located under
// ./prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/libs/$(HOST_ARCH)/<NAME>.so.
func ndkPrebuiltSharedStlFactory() android.Module {
func NdkPrebuiltSharedStlFactory() android.Module {
	module, library := NewLibrary(android.DeviceSupported)
	library.BuildOnlyShared()
	module.compiler = nil
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ func (a *AndroidApp) DepsMutator(ctx android.BottomUpMutatorContext) {
		ctx.AddFarVariationDependencies(variation, tag, a.appProperties.Jni_libs...)
		if String(a.appProperties.Stl) == "c++_shared" {
			if embedJni {
				ctx.AddFarVariationDependencies(variation, tag, "libc++")
				ctx.AddFarVariationDependencies(variation, tag, "ndk_libc++_shared")
			}
		}
	}
+5 −1
Original line number Diff line number Diff line
@@ -1203,6 +1203,10 @@ func TestStl(t *testing.T) {
			compile_multilib: "both",
			sdk_version: "current",
		}

		ndk_prebuilt_shared_stl {
			name: "ndk_libc++_shared",
		}
		`)

	testCases := []struct {
@@ -1212,7 +1216,7 @@ func TestStl(t *testing.T) {
		{"stl",
			[]string{
				"libjni.so",
				"libc++.so",
				"libc++_shared.so",
			},
		},
		{"system",
+3 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ func testContext(config android.Config, bp string,
	ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory))
	ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory))
	ctx.RegisterModuleType("llndk_library", android.ModuleFactoryAdaptor(cc.LlndkLibraryFactory))
	ctx.RegisterModuleType("ndk_prebuilt_shared_stl", android.ModuleFactoryAdaptor(cc.NdkPrebuiltSharedStlFactory))
	ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
		ctx.BottomUp("link", cc.LinkageMutator).Parallel()
		ctx.BottomUp("begin", cc.BeginMutator).Parallel()
@@ -134,6 +135,8 @@ func testContext(config android.Config, bp string,
		"api/test-removed.txt":   nil,
		"framework/aidl/a.aidl":  nil,

		"prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so": nil,

		"prebuilts/sdk/14/public/android.jar":         nil,
		"prebuilts/sdk/14/public/framework.aidl":      nil,
		"prebuilts/sdk/14/system/android.jar":         nil,