Skip to content

Commit 0848269

Browse files
committed
android: add path to libgcc; not working (we probably need real compiler_rt)
1 parent df6f255 commit 0848269

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ set(SWIFT_NATIVE_CLANG_TOOLS_PATH "" CACHE STRING
117117
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "" CACHE STRING
118118
"Path to the directory that contains Swift tools that are executable on the build machine")
119119

120+
set(SWIFT_ANDROID_NDK_PATH "/home/zhuowei/ndk" CACHE STRING
121+
"Path to the directory that contains the Android NDK tools that are executable on the build machine")
120122
# The following only works with the Ninja generator in CMake >= 3.0.
121123
set(SWIFT_PARALLEL_COMPILE_JOBS "" CACHE STRING
122124
"Define the maximum number of concurrent compilation jobs.")

cmake/modules/AddSwift.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ function(_add_variant_c_compile_flags
102102

103103
if("${sdk}" STREQUAL "ANDROID")
104104
list(APPEND result
105-
"-I/home/zhuowei/ndk/sources/cxx-stl/llvm-libc++/libcxx/include"
106-
"-I/home/zhuowei/ndk/sources/android/support/include")
105+
"-I${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libcxx/include"
106+
"-I${SWIFT_ANDROID_NDK_PATH}/sources/android/support/include")
107107
endif()
108108

109109
set("${result_var_name}" "${result}" PARENT_SCOPE)
@@ -163,6 +163,11 @@ function(_add_variant_link_flags
163163

164164
if("${sdk}" STREQUAL "LINUX")
165165
list(APPEND result "-lpthread" "-ldl")
166+
elseif("${sdk}" STREQUAL "ANDROID")
167+
list(APPEND result
168+
"-ldl"
169+
"-L${SWIFT_ANDROID_NDK_PATH}/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.8/thumb"
170+
"${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/thumb/libc++_shared.so")
166171
else()
167172
list(APPEND result "-lobjc")
168173
endif()

utils/build-script-impl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ fi
10831083
if [[ "$DISTCC" ]] ; then
10841084
BUILD_ARGS="${BUILD_ARGS} -j $(distcc -j)"
10851085
fi
1086-
BUILD_ARGS="${BUILD_ARGS} -j1"
1086+
BUILD_ARGS="${BUILD_ARGS} -j2"
10871087

10881088
case "${CMAKE_GENERATOR}" in
10891089
Ninja)

0 commit comments

Comments
 (0)