|
| 1 | +# This source file is part of the Swift.org open source project |
| 2 | +# |
| 3 | +# Copyright (c) 2024 Apple Inc. and the Swift project authors |
| 4 | +# Licensed under Apache License v2.0 with Runtime Library Exception |
| 5 | +# |
| 6 | +# See http://swift.org/LICENSE.txt for license information |
| 7 | +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors |
| 8 | + |
| 9 | +add_library(_Testing_Foundation |
| 10 | + Attachments/EncodingFormat.swift |
| 11 | + Attachments/Attachment+URL.swift |
| 12 | + Attachments/Attachable+NSSecureCoding.swift |
| 13 | + Attachments/Data+Attachable.swift |
| 14 | + Attachments/Attachable+Encodable+NSSecureCoding.swift |
| 15 | + Attachments/Attachable+Encodable.swift |
| 16 | + Events/Clock+Date.swift |
| 17 | + ReexportTesting.swift) |
| 18 | + |
| 19 | +target_link_libraries(_Testing_Foundation PUBLIC |
| 20 | + Testing) |
| 21 | + |
| 22 | +# Although this library links Foundation on all platforms, it only does so using |
| 23 | +# `target_link_libraries()` when building for non-Apple platforms. This is |
| 24 | +# because that command uses the `-lFoundation` linker flag, but on Apple |
| 25 | +# platforms Foundation is a .framework and requires a different flag. However, |
| 26 | +# we don't need to explicitly pass any linker flag since it's handled |
| 27 | +# automatically on Apple platforms via auto-linking. |
| 28 | +if(NOT APPLE) |
| 29 | + target_link_libraries(_Testing_Foundation PUBLIC |
| 30 | + Foundation) |
| 31 | +endif() |
| 32 | + |
| 33 | +# Note: This does not enable Library Evolution, despite emitting a module |
| 34 | +# interface, because Foundation does not have Library Evolution enabled for all |
| 35 | +# platforms. |
| 36 | +target_compile_options(_Testing_Foundation PRIVATE |
| 37 | + -emit-module-interface -emit-module-interface-path $<TARGET_PROPERTY:_Testing_Foundation,Swift_MODULE_DIRECTORY>/_Testing_Foundation.swiftinterface) |
| 38 | + |
| 39 | +_swift_testing_install_target(_Testing_Foundation) |
0 commit comments