From 302b2bc4e7da1991b0fc813c8ae6d861e78c14e4 Mon Sep 17 00:00:00 2001 From: Leonard Grey Date: Mon, 27 Apr 2026 14:06:54 -0400 Subject: [PATCH] Use CMAKE_SYSROOT for Android sysroot Ports https://github.com/swiftlang/swift/pull/87293 --- .github/actions/configure-cmake-project/action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/configure-cmake-project/action.yml b/.github/actions/configure-cmake-project/action.yml index 54adfa2b6..97ae7e995 100644 --- a/.github/actions/configure-cmake-project/action.yml +++ b/.github/actions/configure-cmake-project/action.yml @@ -430,6 +430,7 @@ runs: Add-KeyValueIfNew $Defines CMAKE_ANDROID_API "$AndroidAPILevel" Add-KeyValueIfNew $Defines CMAKE_ANDROID_ARCH_ABI "$AndroidArchABI" Add-KeyValueIfNew $Defines CMAKE_ANDROID_NDK "$AndroidNDKPath" + Add-KeyValueIfNew $Defines CMAKE_SYSROOT "$AndroidSysroot" if ($UseASM) { } @@ -437,7 +438,7 @@ runs: if ($UseC) { Add-KeyValueIfNew $Defines CMAKE_C_COMPILER_TARGET $Triple - $CFLAGS = @("--sysroot=${AndroidSysroot}", "-ffunction-sections", "-fdata-sections") + $CFLAGS = @("-ffunction-sections", "-fdata-sections") if ($DebugInfo) { # Note: On GHA, we build Android with `-gsplit-dwarf`. $CFLAGS += @("-g", "-gsplit-dwarf") @@ -448,7 +449,7 @@ runs: if ($UseCXX) { Add-KeyValueIfNew $Defines CMAKE_CXX_COMPILER_TARGET $Triple - $CXXFLAGS = @("--sysroot=${AndroidSysroot}", "-ffunction-sections", "-fdata-sections") + $CXXFLAGS = @("-ffunction-sections", "-fdata-sections") if ($DebugInfo) { # Note: On GHA, we build Android with `-gsplit-dwarf`. $CXXFLAGS += @("-g", "-gsplit-dwarf")