@@ -16,7 +16,6 @@ local function exec(cmd)
1616end
1717
1818local build = src .. sep .. " build"
19- local ndkRoot = os.getenv (" ANDROID_NDK_ROOT" )
2019
2120--- @format disable-next
2221local gitMin = " -DBUILD_TESTS=OFF -DBUILD_CLI=OFF -DUSE_SSH=OFF -DUSE_GSSAPI=OFF -DUSE_NTLMCLIENT=OFF -DREGEX_BACKEND=builtin -DUSE_HTTP_PARSER=builtin -DCMAKE_C_FLAGS=-g0"
@@ -28,17 +27,6 @@ if isWindows then
2827elseif isMac then
2928 https = " SecureTransport"
3029 cmakeExtra = " "
31- elseif isAndroid and ndkRoot then
32- https = " mbedTLS"
33- local mbedSrc = scriptDir .. " vendor" .. sep .. " mbedtls"
34- local mbedBuild = mbedSrc .. sep .. " build"
35- local mbedOut = mbedSrc .. sep .. " install"
36- local toolchain = ndkRoot .. " /build/cmake/android.toolchain.cmake"
37- local androidFlags = ' -DCMAKE_TOOLCHAIN_FILE="' .. toolchain .. ' " -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-24'
38- exec (' cmake -S "' .. mbedSrc .. ' " -B "' .. mbedBuild .. ' " ' .. androidFlags .. ' -DCMAKE_INSTALL_PREFIX="' .. mbedOut .. ' " -DENABLE_TESTING=OFF -DENABLE_PROGRAMS=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=OFF' )
39- exec (' cmake --build "' .. mbedBuild .. ' " -j$(nproc)' )
40- exec (' cmake --install "' .. mbedBuild .. ' "' )
41- cmakeExtra = androidFlags .. ' -DMBEDTLS_ROOT_DIR="' .. mbedOut .. ' "'
4230else
4331 https = " OpenSSL"
4432 cmakeExtra = " "
@@ -54,6 +42,5 @@ elseif isMac then
5442 exec (' strip -x "' .. outLib .. ' "' )
5543else
5644 exec (' cp "' .. build .. ' /libgit2.so" "' .. outLib .. ' "' )
57- local strip = (isAndroid and ndkRoot ) and (ndkRoot .. " /toolchains/llvm/prebuilt/linux-aarch64/bin/llvm-strip" ) or " strip"
58- exec (strip .. ' --strip-unneeded --remove-section=.eh_frame --remove-section=.eh_frame_hdr "' .. outLib .. ' "' )
45+ exec (' strip --strip-unneeded --remove-section=.eh_frame --remove-section=.eh_frame_hdr "' .. outLib .. ' "' )
5946end
0 commit comments