|
| 1 | +##===----------------------------------------------------------------------===## |
| 2 | +## |
| 3 | +## This source file is part of the SwiftFoundation open source project |
| 4 | +## |
| 5 | +## Copyright (c) 2024 Apple Inc. and the SwiftFoundation project authors |
| 6 | +## Licensed under Apache License v2.0 |
| 7 | +## |
| 8 | +## See LICENSE.txt for license information |
| 9 | +## See CONTRIBUTORS.md for the list of SwiftFoundation project authors |
| 10 | +## |
| 11 | +## SPDX-License-Identifier: Apache-2.0 |
| 12 | +## |
| 13 | +##===----------------------------------------------------------------------===## |
| 14 | + |
| 15 | +cmake_minimum_required(VERSION 3.22) |
| 16 | + |
| 17 | +project(SwiftFoundation |
| 18 | + LANGUAGES C Swift) |
| 19 | + |
| 20 | +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
| 21 | +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
| 22 | +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 23 | +set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift) |
| 24 | + |
| 25 | +set(BUILD_TESTING NO) |
| 26 | + |
| 27 | +# Make sure our dependencies exists |
| 28 | +find_package(SwiftCollections CONFIG REQUIRED) |
| 29 | +find_package(SwiftFoundationICU CONFIG REQUIRED) |
| 30 | +# In the future we will fetch these dependencies if none found |
| 31 | + |
| 32 | +# Availability Macros |
| 33 | +set(_SwiftFoundation_availability_macros) |
| 34 | +list(APPEND _SwiftFoundation_availability_macros |
| 35 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPreview 0.1:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4\">" |
| 36 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPreview 0.2:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4\">" |
| 37 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPreview 0.3:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4\">" |
| 38 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPreview 0.4:macOS 13.3, iOS 16.4, tvOS 16.4, watchOS 9.4\">" |
| 39 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicate 0.1:macOS 14, iOS 17, tvOS 17, watchOS 10\">" |
| 40 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicate 0.2:macOS 14, iOS 17, tvOS 17, watchOS 10\">" |
| 41 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicate 0.3:macOS 14, iOS 17, tvOS 17, watchOS 10\">" |
| 42 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicate 0.4:macOS 14, iOS 17, tvOS 17, watchOS 10\">" |
| 43 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicateRegex 0.1:macOS 10000, iOS 10000, tvOS 10000, watchOS 10000\">" |
| 44 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicateRegex 0.2:macOS 10000, iOS 10000, tvOS 10000, watchOS 10000\">" |
| 45 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicateRegex 0.3:macOS 10000, iOS 10000, tvOS 10000, watchOS 10000\">" |
| 46 | + "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -enable-experimental-feature -Xfrontend \"AvailabilityMacro=FoundationPredicateRegex 0.4:macOS 10000, iOS 10000, tvOS 10000, watchOS 10000\">") |
| 47 | + |
| 48 | +add_subdirectory(Sources) |
| 49 | +add_subdirectory(cmake/modules) |
0 commit comments