Files
swift-mirror/Runtimes/Resync.cmake
Evan Wilde 03ba118bf3 Add swiftCore library
This patch hooks up the swiftCore library build and gets it installing.
This means that we have library evolution hooked up and vector types.

Building it dynamically found that we had duplicate symbols, so fixed
the swiftDemanglingCR library.

Needed to hook up the availability macros.

The flag configuration is for macOS, so we'll need to go through and
figure out what it should look like for the other platforms too.
2024-11-06 21:27:53 -08:00

82 lines
2.6 KiB
CMake

# This CMake script keeps the files in the new standard library build in sync
# with the existing standard library.
# TODO: Once the migration is completed, we can delete this file
cmake_minimum_required(VERSION 3.21)
# Where the standard library lives today
set(StdlibSources "${CMAKE_CURRENT_LIST_DIR}/../stdlib")
message(STATUS "Source dir: ${StdlibSources}")
# Copy the files under the "name" directory in the standard library into the new
# location under Runtimes
function(copy_library_sources name from_prefix to_prefix)
message(STATUS "${name}[${StdlibSources}/${from_prefix}/${name}] -> ${to_prefix}/${name} ")
file(GLOB_RECURSE filenames
FOLLOW_SYMLINKS
LIST_DIRECTORIES FALSE
RELATIVE "${StdlibSources}/${from_prefix}"
"${StdlibSources}/${from_prefix}/${name}/*.swift"
"${StdlibSources}/${from_prefix}/${name}/*.h"
"${StdlibSources}/${from_prefix}/${name}/*.cpp"
"${StdlibSources}/${from_prefix}/${name}/*.c"
"${StdlibSources}/${from_prefix}/${name}/*.mm"
"${StdlibSources}/${from_prefix}/${name}/*.m"
"${StdlibSources}/${from_prefix}/${name}/*.def"
"${StdlibSources}/${from_prefix}/${name}/*.gyb"
"${StdlibSources}/${from_prefix}/${name}/*.apinotes"
"${StdlibSources}/${from_prefix}/${name}/*.yaml"
"${StdlibSources}/${from_prefix}/${name}/*.inc"
"${StdlibSources}/${from_prefix}/${name}/*.modulemap"
"${StdlibSources}/${from_prefix}/${name}/*.json")
foreach(file ${filenames})
# Get and create the directory
get_filename_component(dirname ${file} DIRECTORY)
file(MAKE_DIRECTORY "${to_prefix}/${dirname}")
file(COPY_FILE
"${StdlibSources}/${from_prefix}/${file}" # From
"${CMAKE_CURRENT_LIST_DIR}/${to_prefix}/${file}" # To
RESULT _output
ONLY_IF_DIFFERENT)
if(_output)
message(SEND_ERROR
"Copy ${from_prefix}/${file} -> ${to_prefix}/${file} Failed: ${_output}")
endif()
endforeach()
endfunction()
# Directories in the existing standard library that make up the Core project
# Copy shared core headers
copy_library_sources(include "" "Core")
# Copy magic linker symbols
copy_library_sources("linker-support" "" "Core")
set(CoreLibs
LLVMSupport
SwiftShims
runtime
CompatibilityOverride
stubs
core)
# Add these as we get them building
# core
# Concurrency
# SwiftOnoneSUpport
# CommandLineSupport
# Demangling
# runtime)
foreach(library ${CoreLibs})
copy_library_sources(${library} "public" "Core")
endforeach()
# TODO: Add source directories for the platform overlays, supplemental
# libraries, and test support libraries.