mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This introduces the Android and Math modules for Android in the platform specific overlay.
59 lines
2.3 KiB
CMake
59 lines
2.3 KiB
CMake
|
|
cmake_minimum_required(VERSION 3.26...3.29)
|
|
|
|
set(CMAKE_C_VISIBILITY_PRESET "hidden")
|
|
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
|
|
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
|
|
|
# NOTE: always use the 3-component style as the expansion as
|
|
# `${PROJECT_VERSION}` will not extend this to the complete form and this can
|
|
# change the behaviour for comparison with non-SemVer compliant parsing. If
|
|
# possible, use the 4-version component as that is used to differentiate the
|
|
# builds of the runtime for Windows.
|
|
if($ENV{BUILD_NUMBER})
|
|
# NOTE: SxS modules have a limit on each component being [0-65535].
|
|
# https://learn.microsoft.com/en-us/windows/win32/sbscs/assembly-versions
|
|
math(EXPR BUILD_NUMBER "$ENV{BUILD_NUMBER} % 65535")
|
|
set(BUILD_NUMBER ".${BUILD_NUMBER}")
|
|
endif()
|
|
project(SwiftOverlay
|
|
LANGUAGES C CXX Swift
|
|
VERSION 6.1.0${BUILD_NUMBER})
|
|
|
|
find_package(SwiftCore)
|
|
|
|
# FIXME: We should not need to refer back into the compiler sources. This is
|
|
# needed by gyb and AvailabilityMacros
|
|
set(SwiftOverlay_SWIFTC_SOURCE_DIR
|
|
"${PROJECT_SOURCE_DIR}/../../"
|
|
CACHE FILEPATH "Path to the root source directory of the Swift compiler")
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
include(gyb)
|
|
include(AvailabilityMacros)
|
|
include(DefaultSettings)
|
|
include(EmitSwiftInterface)
|
|
include(PlatformInfo)
|
|
include(ResourceEmbedding)
|
|
|
|
defaulted_option(SwiftOverlay_ENABLE_REFLECTION "Enable runtime support for mirrors and reflection support")
|
|
|
|
option(SwiftOverlay_INSTALL_NESTED_SUBDIR "Install libraries under a platform and architecture subdirectory" ON)
|
|
set(SwiftOverlay_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${SwiftOverlay_INSTALL_NESTED_SUBDIR}>:/${SwiftOverlay_PLATFORM_SUBDIR}/${SwiftOverlay_ARCH_SUBDIR}>")
|
|
set(SwiftOverlay_INSTALL_SWIFTMODULEDIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>$<$<BOOL:${SwiftOverlay_INSTALL_NESTED_SUBDIR}>:/${SwiftOverlay_PLATFORM_SUBDIR}>")
|
|
|
|
add_compile_options(
|
|
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>"
|
|
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>")
|
|
|
|
add_subdirectory(clang)
|
|
if(ANDROID)
|
|
add_subdirectory(Android)
|
|
endif()
|
|
if(WIN32)
|
|
add_subdirectory(Windows)
|
|
endif()
|