Make ndk_prebuilt_*_stl's libDir relative to module
Currently, we have ~4 of these modules which are all defined in prebuilts/ndk. However, using ctx.ModuleDir() instead has the following advantages - makes bp2build simpler since we do not need to relativize this path - prevents soong modules from reaching into another directory (as the test setups were doing). Test: m nothing Change-Id: I780e2564cb37ebf4b800f0cd184789f3fc6f2fc8
This commit is contained in:
@@ -87,9 +87,12 @@ func NdkPrebuiltStaticStlFactory() android.Module {
|
|||||||
return module.Init()
|
return module.Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
libDir = "current/sources/cxx-stl/llvm-libc++/libs"
|
||||||
|
)
|
||||||
|
|
||||||
func getNdkStlLibDir(ctx android.ModuleContext) android.SourcePath {
|
func getNdkStlLibDir(ctx android.ModuleContext) android.SourcePath {
|
||||||
libDir := "prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/libs"
|
return android.PathForSource(ctx, ctx.ModuleDir(), libDir).Join(ctx, ctx.Arch().Abi[0])
|
||||||
return android.PathForSource(ctx, libDir).Join(ctx, ctx.Arch().Abi[0])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ndk *ndkPrebuiltStlLinker) link(ctx ModuleContext, flags Flags,
|
func (ndk *ndkPrebuiltStlLinker) link(ctx ModuleContext, flags Flags,
|
||||||
|
@@ -558,7 +558,7 @@ var PrepareForTestWithCcBuildComponents = android.GroupFixturePreparers(
|
|||||||
// This includes files that are needed by all, or at least most, instances of a cc module type.
|
// This includes files that are needed by all, or at least most, instances of a cc module type.
|
||||||
android.MockFS{
|
android.MockFS{
|
||||||
// Needed for ndk_prebuilt_(shared|static)_stl.
|
// Needed for ndk_prebuilt_(shared|static)_stl.
|
||||||
"prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/libs": nil,
|
"defaults/cc/common/current/sources/cxx-stl/llvm-libc++/libs": nil,
|
||||||
}.AddToFixture(),
|
}.AddToFixture(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user