Merge "Use ndk_system STL header library" into main am: 83c0ea6e26

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2744353

Change-Id: Ib2f51d4407be9942842a0a8807e9a6c375440f3b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-09-13 01:21:12 +00:00
committed by Automerger Merge Worker

View File

@@ -172,6 +172,7 @@ func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
// The system STL doesn't have a prebuilt (it uses the system's libstdc++), but it does have
// its own includes. The includes are handled in CCBase.Flags().
deps.SharedLibs = append([]string{"libstdc++"}, deps.SharedLibs...)
deps.HeaderLibs = append([]string{"ndk_system"}, deps.HeaderLibs...)
case "ndk_libc++_shared", "ndk_libc++_static":
if stl.Properties.SelectedStl == "ndk_libc++_shared" {
deps.SharedLibs = append(deps.SharedLibs, stl.Properties.SelectedStl)
@@ -219,8 +220,7 @@ func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags {
case "libstdc++":
// Nothing
case "ndk_system":
ndkSrcRoot := android.PathForSource(ctx, "prebuilts/ndk/current/sources/cxx-stl/system/include")
flags.Local.CFlags = append(flags.Local.CFlags, "-isystem "+ndkSrcRoot.String())
// Nothing: The exports of ndk_system will be added automatically to the local cflags
case "ndk_libc++_shared", "ndk_libc++_static":
if ctx.Arch().ArchType == android.Arm {
// Make sure the _Unwind_XXX symbols are not re-exported.