Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
096f7f3
Android Intel 32/64 bit (i.e. Android Simulator) support.
vgorloff May 28, 2019
8e1c00c
[Diagnostics] Clarify diagnostic for failed type conversion in subscr…
owenv May 27, 2019
f90cdf5
[Build System: CMake] Add new SWIFT_DARWIN_SUPPORTED_ARCHS CMake cach…
May 29, 2019
1bc3066
[Build System: CMake] Fix the arch-specific target exporting in add_s…
May 29, 2019
4ec6033
[Build System: CMake] Add new SWIFT_DARWIN_MODULE_ARCHS CMake cache v…
May 29, 2019
03dbada
[Build System: CMake] Convert SWIFT_DARWIN_SUPPORTED_ARCHS and SWIFT_…
Rostepher May 29, 2019
029c25a
[Build System: CMake] Ensure the SDK supported architectures and modu…
Rostepher May 29, 2019
1da1151
[Build System: build-script] Add new build-script options to specify …
Rostepher May 29, 2019
84815c8
[windows] Update ICU version to 64.2.
drodriguez May 30, 2019
d940995
[Build System: CMake] Check that targets exist before adding them to …
Jun 2, 2019
12b27a1
IRGen: getSingletonAggregateFieldType must not return field if its ac…
aschwaighofer May 31, 2019
bec3898
Only apply access level constraint if we have a nominal type
aschwaighofer Jun 3, 2019
1c41c08
validation-test: adjust stdlib tests for Windows
compnerd Jun 3, 2019
48976e5
test: add a workaround for `rth` invocation
compnerd Jun 3, 2019
bb2eee1
syntax: silence MSVC warning about unreachable (NFC)
compnerd Jun 3, 2019
299548d
validation-test: avoid shell in HashingRandomization
compnerd Jun 4, 2019
4ed8de1
Revert "Revert "Use autolinking to pull in compatibility libraries.""
jckarter Jun 4, 2019
14f9dc6
Do not try to dsymutil .a files, which is unsupported
jckarter Jun 4, 2019
1e38fc3
Update master to build with Xcode 11 beta, macOS 10.15, iOS 13, tvOS …
shahmishal Jun 4, 2019
192bcb2
Basic: Use APInt to implement ClusteredBitVector
mundaym Jun 3, 2019
a97cdc4
Merge pull request #25216 from aschwaighofer/fix_getSingletonAggregat…
aschwaighofer Jun 4, 2019
c1d007a
Merge pull request #25232 from compnerd/hash
compnerd Jun 4, 2019
c50fee1
tests: improve resilience test helper for Windows
compnerd Jun 3, 2019
2f34b0b
test: invoke scale-test with the interpreter
compnerd Jun 4, 2019
551c1be
validation-test: make stdlib.string compile on Win32
compnerd Jun 4, 2019
38c583e
Merge pull request #25233 from apple/revert-25225-revert-25148-runtim…
jckarter Jun 4, 2019
61aab1d
Merge pull request #25242 from compnerd/strings-are-built
swift-ci Jun 4, 2019
db9a6ca
validation-test: refactor the test invocation (NFC)
compnerd Jun 4, 2019
3d2bead
Merge pull request #25219 from compnerd/interpretation-dictionary
compnerd Jun 4, 2019
9498b14
Merge pull request #25098 from vgorloff/macos-to-android-crosscompile
drodriguez Jun 4, 2019
50a8567
Merge pull request #25241 from compnerd/open-to-interpretation
compnerd Jun 4, 2019
72c6dbb
[ConstraintSystem] Separate parameter label removal from generic func…
xedin Jun 4, 2019
fa513db
Run Sourcekitd-tests in a non dispatch thread
gmittert Jun 3, 2019
a78a298
Merge pull request #25244 from compnerd/independence-day
compnerd Jun 4, 2019
af0b14e
SILGen: refactor `#dsohandle` implementation
compnerd Jun 4, 2019
5856591
SILGen: make `#dsohandle` work properly on Windows
compnerd Jun 4, 2019
655a60a
validation-test: correct typo in ParseableInterface.verify_all_overlays
compnerd Jun 4, 2019
ef1e542
[ConstraintSystem] Extract logic for opening generic parameters into …
xedin Jun 5, 2019
01e7bab
Merge pull request #25251 from compnerd/house-lit
swift-ci Jun 5, 2019
930f74a
[ConstraintSystem] Remove unused inner declaration context parameter …
xedin Jun 5, 2019
1656a65
Merge pull request #25227 from compnerd/gyb-your-silence
compnerd Jun 5, 2019
6cdd981
Merge pull request #25080 from owenv/improve_subscript_assignment_diag
xedin Jun 5, 2019
5f258fb
Merge pull request #25250 from compnerd/spell-different
compnerd Jun 5, 2019
2966f33
Merge pull request #25224 from gmittert/64KOughtToBeEnoughForAnybody
gmittert Jun 5, 2019
a06abbb
IRGen: Generate spare bit mask lazily in StructLayoutBuilder
mundaym Jun 5, 2019
8e01891
IRGen: Fix handling of singleton aggregate projections and tuple types
aschwaighofer Jun 5, 2019
c63114f
stdlib: enable RuntimeUnittest on Windows
compnerd Jun 5, 2019
0e63852
Merge pull request #25240 from linux-on-ibm-z/cluster-to-apint
jckarter Jun 5, 2019
27b56b1
Merge pull request #25262 from compnerd/windows-is-posixy-too
swift-ci Jun 5, 2019
24d6a3c
[ConstraintSystem] Remove `skipGenericRequirements` flag from `openGe…
xedin Jun 5, 2019
0da4a5b
[CSRanking] Remove code duplication related to opening types
xedin Jun 5, 2019
569c8af
[Profiler] Separate profiler instances for property inits and constru…
vedantk Jun 5, 2019
d86ccc9
[ConstraintSystem] Fix regression in partial application of initializers
xedin Jun 5, 2019
574dc53
Update the test simulator to iPhone Xs
shahmishal Jun 5, 2019
a702552
[android] Basic support for backtraces.
drodriguez May 31, 2019
6f80315
validation-test: avoid shell in ParseableInterface.verify_all_overlays
compnerd Jun 5, 2019
fcb0ee5
build: remove `ALL_POSIX_PLATFORMS` which is no longer used
compnerd Jun 5, 2019
1d1c362
StdlibUnittest: consume the carriage return on stdout
compnerd Jun 5, 2019
a82d33f
[SE-0258] Fix crash with implicitly-initialized backing storage.
DougGregor Jun 5, 2019
8abffa7
Use the remaining half bit in the refcount to bypass ObjC deallocatio…
Catfish-Man May 28, 2019
6c349ec
[windows] Use only a drive letter as build directory.
drodriguez Jun 5, 2019
15cd301
Merge pull request #25270 from compnerd/none-of-the-posix
swift-ci Jun 5, 2019
e3af112
Merge pull request #25261 from compnerd/turtles-in-a-half-shell
swift-ci Jun 5, 2019
0565112
Merge pull request #25271 from compnerd/stdout-or-stderr-matters-not
swift-ci Jun 5, 2019
ae68558
[ConstraintSystem] Generalize and extract opening function params/res…
xedin Jun 5, 2019
329ed30
[ConstraintSystem] Make sure that read-only keypath is preferred for …
xedin Jun 6, 2019
189bd6c
Merge pull request #25102 from Catfish-Man/no-objc-complications-2
swift-ci Jun 6, 2019
903547f
[stdlib-standalone] Always configure with lit-args=--filter=stdlib/
gottesmm Jun 6, 2019
a83c04e
Merge pull request #25274 from drodriguez/windows-build-in-short-path
drodriguez Jun 6, 2019
6b8f826
[Test] Update attr_ibaction_ios.swift test to only run on Apple platform
shahmishal Jun 4, 2019
817ea12
Revert "Use the remaining half bit in the refcount to bypass ObjC dea…
shahmishal Jun 6, 2019
10c3218
Merge pull request #25279 from apple/revert-25102-no-objc-complicatio…
shahmishal Jun 6, 2019
d272bfa
Merge pull request #25278 from gottesmm/pr-0cbbc6612ad435dc0e80c82f2a…
swift-ci Jun 6, 2019
14b96d1
[Test] Fix complete_decl_attribute.swift for Xcode 11 beta
shahmishal Jun 6, 2019
8f54aa6
Merge pull request #25259 from aschwaighofer/fix_getSingletonAggregat…
aschwaighofer Jun 6, 2019
bc9eac9
IRGen: Allow stored_property keypaths on class constraint archetypes
aschwaighofer Jun 5, 2019
caa2286
[stdlib_standalone] Add a update-checkout scheme for people to test o…
gottesmm Jun 6, 2019
1a0f894
Merge pull request #25283 from gottesmm/pr-df1b1f4935b535410b90e3cfe9…
swift-ci Jun 6, 2019
b8dec80
[build-script-impl] Use `cmake-file-api` in case the CMake used suppo…
akyrtzi Jun 6, 2019
1a555df
[SE-0258] Fix memberwise initializer involving wrapped properties.
DougGregor Jun 6, 2019
c2848e7
Merge pull request #25236 from apple/update-master-xcode-11-beta1
shahmishal Jun 6, 2019
3fb9a2a
[windows] Fix Python tests in Windows.
drodriguez Jun 5, 2019
3f9ae91
Update the Xcode version required for master branch to Xcode 11 beta
shahmishal Jun 6, 2019
3b4bf28
Merge pull request #25276 from xedin/rdar-51456614
xedin Jun 6, 2019
0f62586
Merge pull request #25265 from xedin/rdar-51442825
xedin Jun 6, 2019
c1087b9
[ConstraintSystem] Remove boolean flags from openGeneric/openFunction…
xedin Jun 6, 2019
65bb06c
Merge pull request #25287 from akyrtzi/build-script-cmake-file-api
swift-ci Jun 6, 2019
19a1e2c
[windows] Fix usage of strtof/d/ld function usage.
drodriguez Jun 6, 2019
1abca4e
Merge pull request #25258 from linux-on-ibm-z/structbuilder
jckarter Jun 6, 2019
9e8c0d0
Add a update-checkout scheme for people to test out stdlib_standalone.
gottesmm Jun 6, 2019
8ef1656
Merge pull request #25285 from gottesmm/pr-33b3bd0f74a4d0569eb2391bb8…
swift-ci Jun 6, 2019
53474b8
Merge pull request #25267 from apple/shahmishal-patch-3
shahmishal Jun 7, 2019
9706668
[benchmark] RandomIntegersLCG futureproofed
palimondo Jun 7, 2019
c80d243
Merge pull request #25295 from palimondo/futureproof-randLCG-bench
palimondo Jun 7, 2019
36b2625
[Parse] Add missing const qualifier to getSplitTokens()
broadwaylamb Jun 7, 2019
26918a8
[update-checkout] Update stdlib_standalone preset for the snapshot re…
gottesmm Jun 7, 2019
c8e0d88
Merge pull request #25297 from gottesmm/pr-a17077898da14b1218487a4c07…
shahmishal Jun 7, 2019
aef830d
[GenEnum] Fix getBitMaskForNoPayloadElements.
Jun 7, 2019
851e675
[standalone_stdlib] Do not test cmark when building standalone.
gottesmm Jun 7, 2019
1b198ea
Merge pull request #25299 from gottesmm/pr-50ee231a2e5e8b83221d1f57d7…
shahmishal Jun 7, 2019
f0e3a99
[Doc] [SR-10094] Add missing documentation for SE-0237
fassko Jun 7, 2019
50f04b7
Improve warning message for defer_stmt_at_block_end
kagemiku Jun 7, 2019
f79eb3b
swift_demangle: update buffer size after copying
Azoy Jun 7, 2019
78802be
SR-20 Update swift --help to explain multitool support ("swift build"…
kelhutch17 Jun 8, 2019
9eb0ebe
Fix for SR-10550, Help for -target option (#25311)
rayfix Jun 8, 2019
07e6940
[Diagnostics] Add a fix-it for misplaced throws in function types (#2…
tapthaker Jun 8, 2019
00e30dd
Merge pull request #25291 from xedin/refactor-open-generic
xedin Jun 8, 2019
fbba1f7
Fix tests for warning messages of defer_stmt_at_block_end
kagemiku Jun 8, 2019
a67ffad
Merge pull request #25296 from broadwaylamb/patch-2
rintaro Jun 8, 2019
e273d05
[Sema] Add notes to explain why Equatable/Hashable conformance couldn…
owenv May 25, 2019
2bc397b
Merge pull request #25292 from drodriguez/windows-fix-numeric-parsing
compnerd Jun 8, 2019
9bbb853
add demangle truncate test
Azoy Jun 9, 2019
d504f72
test: simplify Windows configuration, categorise (NFC)
compnerd Jun 9, 2019
866f316
SILOptimizer: Simplify dead method elimination
slavapestov Jun 1, 2019
f681cbe
SIL: Remove SILVTable::Entry::Linkage
slavapestov Jun 1, 2019
cf0405c
[clf] Simplify the double diamond lifetime extension for escaping swi…
gottesmm Jun 8, 2019
165fc40
Merge pull request #25272 from DougGregor/property-wrappers-default-i…
swift-ci Jun 10, 2019
4b5a85a
Fix a bug in root and add a test case for it.
stephentyrone Jun 10, 2019
bd6fa67
Fix generic class constraint keypath
aschwaighofer Jun 10, 2019
6dcc946
Merge pull request #25312 from kelhutch17/sr-20
jrose-apple Jun 10, 2019
bab64fb
Merge pull request #25326 from stephentyrone/negative-root-bug
swift-ci Jun 10, 2019
9cba37f
Apply Override Fixit to Variable Declarations
phillfarrugia Jun 10, 2019
b90e413
Merge pull request #25320 from gottesmm/pr-393856a2bc74013494a4598e46…
gottesmm Jun 10, 2019
fb6236d
Merge pull request #25319 from compnerd/hash-my-variant
compnerd Jun 10, 2019
4e0ed88
Merge pull request #25220 from compnerd/run-path-emulation
compnerd Jun 10, 2019
62cb79b
Merge pull request #25213 from compnerd/standard-validation
compnerd Jun 10, 2019
8db65b3
Merge pull request #25122 from Rostepher/darwin-supported-archs
Rostepher Jun 10, 2019
12c7cea
test: make the StdlibUnittest.Common pass on Windows
compnerd Jun 10, 2019
15ecf92
Merge pull request #25281 from aschwaighofer/class_constrained_stored…
aschwaighofer Jun 10, 2019
b9917c3
Merge pull request #25298 from dcci/rdar51211938
dcci Jun 10, 2019
ad91323
Merge pull request #25161 from drodriguez/android-backtraces
compnerd Jun 10, 2019
ce3a5d1
Merge pull request #25332 from compnerd/path-separators-are-not-common
compnerd Jun 10, 2019
6fd332d
Doc-serialization: skip declarations with double-underscore as name p…
nkcsgexi Jun 4, 2019
fe32ba1
Add missing newlines
johnno1962 Jun 10, 2019
2a76bcb
Add WinSDK constants to get Symlink Information
gmittert Jun 10, 2019
105e4ad
[TSan] Add positive test for TSan + Dispatch on Linux
yln May 14, 2019
1f08ed4
Wire libdispatch build path through CMake
yln May 30, 2019
76095d4
Merge pull request #25134 from drodriguez/windows-update-icu-for-ci
compnerd Jun 10, 2019
0b27345
Swift should complain about weak references to classes that don't sup…
ChristopherRogers Jul 6, 2018
da22342
Typo/grammar fixes
ChristopherRogers Jul 6, 2018
c0da367
Remove duplicate include
ChristopherRogers Jun 8, 2019
db6f15e
Fix broken test on Linux
ChristopherRogers Jun 10, 2019
c62f0d1
Merge pull request #25307 from kagemiku/change-warning-message-for-de…
jrose-apple Jun 10, 2019
6c17766
Merge pull request #25315 from phillfarrugia/SR-10292
jrose-apple Jun 10, 2019
e8a7845
Merge pull request #25245 from nkcsgexi/doc-filter-serailization
nkcsgexi Jun 10, 2019
77a6c9e
Merge pull request #25191 from slavapestov/vtable-thunk-cleanup
slavapestov Jun 11, 2019
01cf8a8
tests: disable backward deployment tests on Windows
compnerd Jun 10, 2019
c7cf966
SourceKit/Indentation: align function names in chained trailing closures
nkcsgexi Jun 11, 2019
b106328
[Foundation] Bridge difference APIs between Foundation and swift stdlib
numist Jun 11, 2019
89b918a
[Foundation] Temporarily revert to 9999 versions
lorentey Jun 11, 2019
2bc648c
[stdlib] Lemire’s Nearly Divisionless Random Integer Generation (#25286)
palimondo Jun 11, 2019
cc6855b
Merge pull request #17792 from ChristopherRogers/master
jrose-apple Jun 11, 2019
fdd7fc8
Merge pull request #25341 from compnerd/resilience-is-not-built
compnerd Jun 11, 2019
61e7a9a
Merge pull request #25342 from nkcsgexi/indent-chain-call
nkcsgexi Jun 11, 2019
6798eea
Evolution: Some of these tests pass with swift_test_mode_optimize_non…
slavapestov Jun 11, 2019
712927c
Sema: Go back to synthesizing hashValue on _StoredBridgedNSError conf…
slavapestov Jun 11, 2019
c84aad8
Sema: TypeChecker::conformsToProtocol() is static
slavapestov Jun 11, 2019
823ba0b
Convert ObjectLiteralExpr to not use tc.callWitness() or generate a S…
pschuh Mar 28, 2019
6e90172
AST: Remove unnecessary fast path
slavapestov Jun 11, 2019
ae5a427
AST: Fix ProtocolConformance::getWitnessDeclRef()
slavapestov Jun 11, 2019
37daa03
Merge pull request #25344 from slavapestov/evolution-tests-vs-dynamic…
slavapestov Jun 11, 2019
0f27d60
Merge pull request #25076 from owenv/improve_equatable_hashable_synth…
swift-ci Jun 11, 2019
defd518
Merge pull request #25334 from gmittert/DeviceIoControl
gmittert Jun 11, 2019
f5ab62a
[SE-0258] Move "has lazy resolver" check later to handle merge-module…
DougGregor Jun 11, 2019
5e00f01
[SE-0258] Ensure that we fully check the property type vs. wrapper's …
DougGregor Jun 11, 2019
7ff22f5
Merge pull request #25266 from drodriguez/windows-fix-python-tests
compnerd Jun 11, 2019
4a85892
Merge pull request #25351 from DougGregor/property-wrappers-merge-mod…
swift-ci Jun 11, 2019
2b19064
SourceKit/Indentation: avoid indenting the end of subscript expressio…
nkcsgexi Jun 11, 2019
6ee5774
Merge pull request #25349 from slavapestov/synthesized-hashValue-abi-…
slavapestov Jun 11, 2019
bbd44a1
Replace two #ifs with #if/#else in new integer random algorithm (#25352)
stephentyrone Jun 11, 2019
5d59600
Merge pull request #25350 from slavapestov/object-literal-expr
slavapestov Jun 11, 2019
b481755
Merge pull request #25345 from lorentey/foundation-diff-apis
lorentey Jun 11, 2019
fd39f2f
Merge pull request #25301 from fassko/SR_10094_withContiguousStorageI…
lorentey Jun 11, 2019
4bd5a1e
[Diagnostics] Clarify requirement failure source when it's anchored a…
xedin Jun 11, 2019
891494e
Merge pull request #25355 from nkcsgexi/indent-subs-end
nkcsgexi Jun 11, 2019
25fafc4
Merge pull request #25353 from DougGregor/property-wrappers-consisten…
swift-ci Jun 11, 2019
7beb358
Merge pull request #25335 from johnno1962/missing-newlines
xwu Jun 11, 2019
3491fec
Revert "Sema: Go back to synthesizing hashValue on _StoredBridgedNSEr…
slavapestov Jun 11, 2019
67fd1f2
Foundation: Manually define hashValue witnesses for CocoaError, URLEr…
slavapestov Jun 11, 2019
5280254
Sourcekit/Indentation: avoid indenting dot member access appearing af…
nkcsgexi Jun 11, 2019
9298944
Merge pull request #24756 from apple/tsan-positive-tests
yln Jun 11, 2019
81156b2
Merge pull request #25357 from xedin/rdar-51587755
xedin Jun 11, 2019
f9324d8
Merge pull request #25361 from slavapestov/simpler-hash-value-abi-bre…
slavapestov Jun 11, 2019
9f070ed
Merge pull request #25308 from Azoy/demangle-bug-thing
compnerd Jun 11, 2019
a325058
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-06-06-a' into tensorflow-m…
dan-zheng Jun 12, 2019
58827bb
Merge pull request #25362 from nkcsgexi/dot-expr-closure
nkcsgexi Jun 12, 2019
8d0914e
Merge remote-tracking branch 'apple/master' into tensorflow-merge
dan-zheng Jun 12, 2019
e2b06ef
Merge branch 'tensorflow' of github.com:apple/swift into tensorflow-m…
dan-zheng Jun 12, 2019
8a93624
Merge branch 'tensorflow' of github.com:apple/swift into tensorflow-m…
dan-zheng Jun 13, 2019
52c50a7
Fix DifferentiationUnittest.
dan-zheng Jun 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,17 @@ option(SWIFT_STDLIB_ENABLE_SIB_TARGETS
"Should we generate sib targets for the stdlib or not?"
FALSE)


set(SWIFT_DARWIN_SUPPORTED_ARCHS "" CACHE STRING
"Semicolon-separated list of architectures to configure on Darwin platforms. \
If left empty all default architectures are configured.")

set(SWIFT_DARWIN_MODULE_ARCHS "" CACHE STRING
"Semicolon-separated list of architectures to configure Swift module-only \
targets on Darwin platforms. These targets are in addition to the full \
library targets.")


#
# User-configurable Android specific options.
#
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Please make sure you use Python 2.x. Python 3.x is not supported currently.

#### macOS

To build for macOS, you need [Xcode 10.2 beta](https://developer.apple.com/xcode/downloads/).
To build for macOS, you need [Xcode 11 beta](https://developer.apple.com/xcode/downloads/).
The required version of Xcode changes frequently, and is often a beta release.
Check this document for the current required version.

Expand Down
61 changes: 0 additions & 61 deletions apinotes/Accelerate.apinotes

This file was deleted.

2 changes: 0 additions & 2 deletions apinotes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
set(sources
Accelerate.apinotes
Dispatch.apinotes
ScriptingBridge.apinotes
os.apinotes
)

Expand Down
5 changes: 0 additions & 5 deletions apinotes/ScriptingBridge.apinotes

This file was deleted.

2 changes: 1 addition & 1 deletion benchmark/single-source/RandomValues.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public func run_RandomIntegersLCG(_ N: Int) {
for _ in 0 ..< 100_000 {
x &+= Int64.random(in: 0...10_000, using: &generator)
}
CheckResults(x == 498214315)
blackHole(x)
}
}

Expand Down
139 changes: 120 additions & 19 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ function(_add_variant_c_compile_flags)
"-fcoverage-mapping")
endif()

if((CFLAGS_ARCH STREQUAL "armv7" OR CFLAGS_ARCH STREQUAL "aarch64") AND
(CFLAGS_SDK STREQUAL "LINUX" OR CFLAGS_SDK STREQUAL "ANDROID"))
list(APPEND result -funwind-tables)
endif()

if("${CFLAGS_SDK}" STREQUAL "ANDROID")
swift_android_libcxx_include_paths(CFLAGS_CXX_INCLUDES)
swift_android_include_for_arch("${CFLAGS_ARCH}" "${CFLAGS_ARCH}_INCLUDE")
Expand Down Expand Up @@ -465,6 +470,10 @@ function(_add_variant_link_flags)
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a")
elseif("${LFLAGS_ARCH}" MATCHES aarch64)
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a")
elseif("${LFLAGS_ARCH}" MATCHES i686)
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/x86")
elseif("${LFLAGS_ARCH}" MATCHES x86_64)
set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/x86_64")
else()
message(SEND_ERROR "unknown architecture (${LFLAGS_ARCH}) for android")
endif()
Expand Down Expand Up @@ -738,7 +747,8 @@ function(_add_swift_library_single target name)
OBJECT_LIBRARY
SHARED
STATIC
TARGET_LIBRARY)
TARGET_LIBRARY
INSTALL_WITH_SHARED)
set(SWIFTLIB_SINGLE_single_parameter_options
ARCHITECTURE
DEPLOYMENT_VERSION_IOS
Expand Down Expand Up @@ -933,6 +943,17 @@ function(_add_swift_library_single target name)
endif()
endif()

# Only build the modules for any arch listed in the *_MODULE_ARCHITECTURES.
if(SWIFTLIB_SINGLE_SDK IN_LIST SWIFT_APPLE_PLATFORMS
AND SWIFTLIB_SINGLE_ARCHITECTURE IN_LIST SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_MODULE_ARCHITECTURES)
# Create dummy target to hook up the module target dependency.
add_custom_target("${target}"
DEPENDS
"${swift_module_dependency_target}")

return()
endif()

set(SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS)
foreach(object_library ${SWIFTLIB_SINGLE_INCORPORATE_OBJECT_LIBRARIES})
list(APPEND SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS
Expand Down Expand Up @@ -1118,18 +1139,24 @@ function(_add_swift_library_single target name)
BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
LIBRARY_DIR ${SWIFT_LIBRARY_OUTPUT_INTDIR})

if(SWIFTLIB_INSTALL_WITH_SHARED)
set(swift_lib_dir ${SWIFTLIB_DIR})
else()
set(swift_lib_dir ${SWIFTSTATICLIB_DIR})
endif()

foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config_upper)
escape_path_for_xcode(
"${config}" "${SWIFTSTATICLIB_DIR}" config_lib_dir)
"${config}" "${swift_lib_dir}" config_lib_dir)
set_target_properties(${target_static} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR}
ARCHIVE_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR})
endforeach()

set_target_properties(${target_static} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${SWIFTSTATICLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}
ARCHIVE_OUTPUT_DIRECTORY ${SWIFTSTATICLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR})
LIBRARY_OUTPUT_DIRECTORY ${swift_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR}
ARCHIVE_OUTPUT_DIRECTORY ${swift_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR})
endif()

set_target_properties(${target}
Expand Down Expand Up @@ -1380,8 +1407,14 @@ function(_add_swift_library_single target name)
set_property(TARGET "${target_static}" APPEND_STRING PROPERTY
COMPILE_FLAGS " ${c_compile_flags}")
# FIXME: The fallback paths here are going to be dynamic libraries.

if(SWIFTLIB_INSTALL_WITH_SHARED)
set(search_base_dir ${SWIFTLIB_DIR})
else()
set(search_base_dir ${SWIFTSTATICLIB_DIR})
endif()
set(library_search_directories
"${SWIFTSTATICLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}"
"${search_base_dir}/${SWIFTLIB_SINGLE_SUBDIR}"
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR}"
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
swift_target_link_search_directories("${target_static}" "${library_search_directories}")
Expand Down Expand Up @@ -1510,6 +1543,7 @@ endfunction()
# [IS_STDLIB]
# [IS_STDLIB_CORE]
# [TARGET_LIBRARY]
# [INSTALL_WITH_SHARED]
# INSTALL_IN_COMPONENT comp
# DEPLOYMENT_VERSION_OSX version
# DEPLOYMENT_VERSION_IOS version
Expand Down Expand Up @@ -1616,6 +1650,9 @@ endfunction()
# DEPLOYMENT_VERSION_WATCHOS
# The minimum deployment version to build for if this is an WATCHOS library.
#
# INSTALL_WITH_SHARED
# Install a static library target alongside shared libraries
#
# source1 ...
# Sources to add into this library.
function(add_swift_target_library name)
Expand All @@ -1630,7 +1667,8 @@ function(add_swift_target_library name)
OBJECT_LIBRARY
SHARED
STATIC
TARGET_LIBRARY)
TARGET_LIBRARY
INSTALL_WITH_SHARED)
set(SWIFTLIB_single_parameter_options
DEPLOYMENT_VERSION_IOS
DEPLOYMENT_VERSION_OSX
Expand Down Expand Up @@ -1704,7 +1742,6 @@ function(add_swift_target_library name)
if("${SWIFTLIB_TARGET_SDKS}" STREQUAL "")
set(SWIFTLIB_TARGET_SDKS ${SWIFT_SDKS})
endif()
list_replace(SWIFTLIB_TARGET_SDKS ALL_POSIX_PLATFORMS "ALL_APPLE_PLATFORMS;ANDROID;CYGWIN;FREEBSD;LINUX;HAIKU")
list_replace(SWIFTLIB_TARGET_SDKS ALL_APPLE_PLATFORMS "${SWIFT_APPLE_PLATFORMS}")

# All Swift code depends on the standard library, except for the standard
Expand Down Expand Up @@ -1858,8 +1895,13 @@ function(add_swift_target_library name)
list(APPEND swiftlib_link_flags_all "-Wl,-z,defs")
endif()

set(sdk_supported_archs
${SWIFT_SDK_${sdk}_ARCHITECTURES}
${SWIFT_SDK_${sdk}_MODULE_ARCHITECTURES})
list(REMOVE_DUPLICATES sdk_supported_archs)

# For each architecture supported by this SDK
foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES})
foreach(arch ${sdk_supported_archs})
# Configure variables for this subdirectory.
set(VARIANT_SUFFIX "-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
set(VARIANT_NAME "${name}${VARIANT_SUFFIX}")
Expand Down Expand Up @@ -1915,6 +1957,7 @@ function(add_swift_target_library name)
${SWIFTLIB_SHARED_keyword}
${SWIFTLIB_STATIC_keyword}
${SWIFTLIB_OBJECT_LIBRARY_keyword}
${SWIFTLIB_INSTALL_WITH_SHARED_keyword}
${SWIFTLIB_SOURCES}
MODULE_TARGET ${MODULE_VARIANT_NAME}
SDK ${sdk}
Expand Down Expand Up @@ -1980,11 +2023,38 @@ function(add_swift_target_library name)
endforeach()
endif()

# Note this thin library.
list(APPEND THIN_INPUT_TARGETS ${VARIANT_NAME})
if(arch IN_LIST SWIFT_SDK_${sdk}_ARCHITECTURES)
# Note this thin library.
list(APPEND THIN_INPUT_TARGETS ${VARIANT_NAME})
endif()
endif()
endforeach()

# Configure module-only targets
if(NOT SWIFT_SDK_${sdk}_ARCHITECTURES
AND SWIFT_SDK_${sdk}_MODULE_ARCHITECTURES)
set(_target "${name}-${SWIFT_SDK_${sdk}_LIB_SUBDIR}")

# Create unified sdk target
add_custom_target("${_target}")

foreach(_arch ${SWIFT_SDK_${sdk}_MODULE_ARCHITECTURES})
set(_variant_suffix "-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${_arch}")
set(_module_variant_name "${name}-swiftmodule-${_variant_suffix}")

add_dependencies("${_target}" ${_module_variant_name})

# Add Swift standard library targets as dependencies to the top-level
# convenience target.
if(TARGET "swift-stdlib${_variant_suffix}")
add_dependencies("swift-stdlib${_variant_suffix}"
"${_target}")
endif()
endforeach()

return()
endif()

if(NOT SWIFTLIB_OBJECT_LIBRARY)
# Determine the name of the universal library.
if(SWIFTLIB_SHARED)
Expand Down Expand Up @@ -2029,7 +2099,7 @@ function(add_swift_target_library name)
set(resource_dir_sdk_subdir "${SWIFT_SDK_${sdk}_LIB_SUBDIR}")
precondition(resource_dir_sdk_subdir)

if(SWIFTLIB_SHARED)
if(SWIFTLIB_SHARED OR SWIFTLIB_INSTALL_WITH_SHARED)
set(resource_dir "swift")
set(file_permissions
OWNER_READ OWNER_WRITE OWNER_EXECUTE
Expand Down Expand Up @@ -2075,12 +2145,35 @@ function(add_swift_target_library name)
endforeach()
endif()

swift_is_installing_component("${SWIFTLIB_INSTALL_IN_COMPONENT}" is_installing)
if(NOT is_installing)
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${VARIANT_NAME})
else()
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${VARIANT_NAME})
endif()
swift_is_installing_component(
"${SWIFTLIB_INSTALL_IN_COMPONENT}"
is_installing)

# Add the arch-specific library targets to the global exports.
foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES})
set(_variant_name "${name}-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
if(NOT TARGET "${_variant_name}")
continue()
endif()

if(is_installing)
set_property(GLOBAL APPEND
PROPERTY SWIFT_EXPORTS ${_variant_name})
else()
set_property(GLOBAL APPEND
PROPERTY SWIFT_BUILDTREE_EXPORTS ${_variant_name})
endif()
endforeach()

# Add the swiftmodule-only targets to the lipo target depdencies.
foreach(arch ${SWIFT_SDK_${sdk}_MODULE_ARCHITECTURES})
set(_variant_name "${name}-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
if(NOT TARGET "${_variant_name}")
continue()
endif()

add_dependencies("${lipo_target}" "${_variant_name}")
endforeach()

# If we built static variants of the library, create a lipo target for
# them.
Expand All @@ -2091,10 +2184,18 @@ function(add_swift_target_library name)
list(APPEND THIN_INPUT_TARGETS_STATIC "${TARGET}-static")
endforeach()

if(SWIFTLIB_INSTALL_WITH_SHARED)
set(install_subdir "swift")
set(universal_subdir ${SWIFTLIB_DIR})
else()
set(install_subdir "swift_static")
set(universal_subdir ${SWIFTSTATICLIB_DIR})
endif()

set(lipo_target_static
"${name}-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-static")
set(UNIVERSAL_LIBRARY_NAME
"${SWIFTSTATICLIB_DIR}/${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
"${universal_subdir}/${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
_add_swift_lipo_target(SDK
${sdk}
TARGET
Expand All @@ -2103,7 +2204,7 @@ function(add_swift_target_library name)
"${UNIVERSAL_LIBRARY_NAME}"
${THIN_INPUT_TARGETS_STATIC})
swift_install_in_component(FILES "${UNIVERSAL_LIBRARY_NAME}"
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift_static/${resource_dir_sdk_subdir}"
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${install_subdir}/${resource_dir_sdk_subdir}"
PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_READ
Expand Down
Loading