This repository has been archived by the owner on Aug 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from vgorloff/develop
RC 1.0.20
- Loading branch information
Showing
10 changed files
with
183 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 74b7849816c68bf492fd49f76bc735af84bf3ad0..0a1ec4b846243bf0916ce523ea3292340b7fcdf0 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -35,6 +35,14 @@ include(DispatchUtilities) | ||
set(SWIFT_LIBDIR "lib" CACHE PATH "Library folder name, defined by swift main buildscript") | ||
set(INSTALL_LIBDIR "${SWIFT_LIBDIR}" CACHE PATH "Path where the libraries should be installed") | ||
|
||
+# User-configurable Android specific options. | ||
+set(SWIFT_ANDROID_API_LEVEL "" CACHE STRING | ||
+ "Version number for the Android API") | ||
+set(SWIFT_ANDROID_NDK_PATH "" CACHE STRING | ||
+ "Path to the directory that contains the Android NDK tools that are executable on the build machine") | ||
+set(SWIFT_ANDROID_NDK_GCC_VERSION "" CACHE STRING | ||
+ "The GCC version to use when building for Android. Currently only 4.9 is supported.") | ||
+ | ||
include(DispatchAppleOptions) | ||
include(DispatchSanitization) | ||
|
12 changes: 0 additions & 12 deletions
12
Patches/swift-corelibs-libdispatch/cmake/modules/DispatchCompilerWarnings.cmake.diff
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
Patches/swift-corelibs-libdispatch/src/CMakeLists.txt.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index cefde62a5538b8ff2acbf14baaccefa5ac65b9f0..019aab5c41b3af275b584bc2e9b99625a212bd05 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -120,6 +120,42 @@ if(ENABLE_SWIFT) | ||
set(use_ld_flag -use-ld=gold) | ||
endif() | ||
|
||
+ # Android specific configuration. | ||
+ # TODO: Add checks and raise warnings if `SWIFT_ANDROID_*` variables not set. | ||
+ if(CMAKE_SYSTEM_NAME STREQUAL Android) | ||
+ if("${ANDROID_ABI}" STREQUAL "armeabi-v7a") | ||
+ set(SWIFT_SDK_ANDROID_ARCH_NDK_TRIPLE "arm-linux-androideabi") | ||
+ set(SWIFT_SDK_ANDROID_SWIFT_ARCH_NAME "armv7") | ||
+ elseif("${ANDROID_ABI}" STREQUAL "arm64-v8a") | ||
+ set(SWIFT_SDK_ANDROID_ARCH_NDK_TRIPLE "aarch64-linux-android") | ||
+ set(SWIFT_SDK_ANDROID_SWIFT_ARCH_NAME "aarch64") | ||
+ elseif("${ANDROID_ABI}" STREQUAL "x86") | ||
+ set(SWIFT_SDK_ANDROID_ARCH_NDK_TRIPLE "i686-linux-android") | ||
+ set(SWIFT_SDK_ANDROID_SWIFT_ARCH_NAME "i686") | ||
+ elseif("${ANDROID_ABI}" STREQUAL "x86_64") | ||
+ set(SWIFT_SDK_ANDROID_ARCH_NDK_TRIPLE "x86_64-linux-android") | ||
+ set(SWIFT_SDK_ANDROID_SWIFT_ARCH_NAME "x86_64") | ||
+ else() | ||
+ message(FATAL_ERROR "Unknown arch for android SDK: ${ANDROID_ABI}") | ||
+ endif() | ||
+ | ||
+ # Get the prebuilt suffix to create the correct toolchain path when using the NDK | ||
+ if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") | ||
+ set(_swift_android_prebuilt_build "darwin-x86_64") | ||
+ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") | ||
+ set(_swift_android_prebuilt_build "linux-x86_64") | ||
+ endif() | ||
+ set(SWIFT_SDK_ANDROID_ARCH_NDK_PREBUILT_PATH "${SWIFT_ANDROID_NDK_PATH}/toolchains/llvm/prebuilt/${_swift_android_prebuilt_build}") | ||
+ | ||
+ # Setting Android specific Swift flags. | ||
+ get_filename_component(swift_android_lib_directory_path ${CMAKE_SWIFT_COMPILER} DIRECTORY) | ||
+ set(swift_android_lib_directory_path ${swift_android_lib_directory_path}/../lib/swift/android/${SWIFT_SDK_ANDROID_SWIFT_ARCH_NAME}) | ||
+ get_filename_component(swift_android_lib_directory_path ${swift_android_lib_directory_path} ABSOLUTE) | ||
+ | ||
+ set(swift_android_link_flags -L ${swift_android_lib_directory_path} -tools-directory ${SWIFT_SDK_ANDROID_ARCH_NDK_PREBUILT_PATH}/bin) | ||
+ set(swift_android_compile_flags -Xcc -I${SWIFT_ANDROID_NDK_PATH}/sysroot/usr/include -Xcc -I${SWIFT_ANDROID_NDK_PATH}/sysroot/usr/include/${SWIFT_SDK_ANDROID_ARCH_NDK_TRIPLE}) | ||
+ endif() | ||
+ | ||
add_swift_library(swiftDispatch | ||
CFLAGS | ||
-fblocks | ||
@@ -129,6 +165,7 @@ if(ENABLE_SWIFT) | ||
DispatchStubs | ||
LINK_FLAGS | ||
${use_ld_flag} | ||
+ ${swift_android_link_flags} | ||
-lDispatchStubs | ||
-L $<TARGET_LINKER_FILE_DIR:BlocksRuntime> | ||
-lBlocksRuntime | ||
@@ -160,6 +197,7 @@ if(ENABLE_SWIFT) | ||
# TODO(compnerd) handle /MT builds | ||
$<$<PLATFORM_ID:Windows>:-Xcc> | ||
$<$<PLATFORM_ID:Windows>:-D_DLL> | ||
+ ${swift_android_compile_flags} | ||
TARGET | ||
${CMAKE_C_COMPILER_TARGET}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.19 | ||
1.0.20 |