Commit Graph

64 Commits

Author SHA1 Message Date
Justice Adams
ff3fdd32ee [cmake] Use correct identifier for CFBundleIdentifier (#83960)
Use the associated library name for the `CFBundleIdentifier` within the
plist. This will prevent cases where we have projects with multiple
targets referencing the project name itself (i.e swiftSwiftOnoneSupport
had it's bundle name set to SwiftCore)
2025-08-29 10:28:21 -07:00
Eric Miotto
48fd452cd6 macOS smoketest: enable Distributed and Synchronization in runtimes
To make this work:
* expose SwiftCMakeConfig.h from the Core build
system, to support scenarios in which the downstream Distributed build
is leveraging the config files generated by CMake itself.
* adjust how SwiftShims is defined in `FindSwiftCore.cmake`, so that the
shims are found from C++ and that we don't get redefinition errors
when multiple module maps are in the search paths.

Fixes #83449
Addresses rdar://149241603, rdar://157165530
2025-08-08 13:17:19 -07:00
Guillaume Lessard
db93172db8 [stdlib] list files for cmake 2025-07-14 23:04:47 -07:00
Stephen Canon
592d72bba9 Concrete SIMD.init(repeating:) and SIMD.init(lowHalf:highHalf:) optimizations (#81766)
WIP to add more overloads to optimize SIMD codegen on concrete types.
Here we do:

- init(repeating:)
- init(lowHalf:highHalf:)

These are always inlined, even in debug, since LLVM knows how to lower
them to one or two instructions on the targets that we care about.
2025-05-27 15:15:13 -04:00
Saleem Abdulrasool
028624c30d Runtimes: mark CommandLineSupporta as an OBJECT library
This allows compaction into swiftCore when building mirroring the
beahviour of the old build system. This matters solely when building
with a static library distribution of swiftCore where you would
previously need to explicitly link against the swiftCommandLineSupport
library when building with the new build system.
2025-05-19 17:36:49 -07:00
Michael Gottesman
9d59dbed17 [swift-settings] Now that we aren't using it immediately, remove it from tree.
We can always get it back from the git history.

rdar://150695113
2025-05-05 13:39:03 -07:00
Saleem Abdulrasool
30f3f865bf Runtimes: manually adjust the library prefix for core,Concurrency
These libraries use C++ as the linker language which will prevent
`CMAKE_STATIC_LIBRARY_PREFIX_Swift` from impacting them. Wire this
property to the target manually so that it takes effect. This is
primarily meant to support Windows, where we use a non-standard library
prefix for static libraries mirroring the behaviour of the language
runtimes (i.e. ucrt, vcruntime, msvcrt).
2025-04-23 11:48:17 -07:00
Eric Miotto
1fa9c7ae37 [SwiftCore] emit correct names for symbols that can be backdeployed
This matches the flag that was added to the old build system in
b0627e28a2

Addresses rdar://149410833
2025-04-17 09:15:45 -07:00
Michael Ilseman
e6e4bd6056 UTF8Span (#78531)
Add support for UTF8Span

Also, refactor validation and grapheme breaking
2025-04-11 16:11:11 -06:00
Guillaume Lessard
c9b1ab8c42 Merge pull request #79650 from glessard/rdar138440979-MutableSpan
[SE-0467] MutableSpan, with mutableSpan properties to Array, ArraySlice and ContiguousArray.
2025-03-28 17:59:47 -07:00
Guillaume Lessard
51db21acc4 [build] add files for the new build system 2025-03-27 16:55:06 -07:00
Evan Wilde
bfa5269dec [SwiftCore] Enable explicit module builds
Explicit module builds help prevent the dependency scanner from getting
lost and attempting to pull the SwiftShims module from the resource
directory, existing SDK, and the just-built standard library.
They aren't part of the library interface, but make it possible to build
the runtime libraries without seeing duplicate shims. Moving the flag to
a top-level compile command.
2025-03-27 15:20:09 -07:00
Saleem Abdulrasool
a17cf9b785 Merge pull request #80250 from compnerd/dependencies
Runtimes: establish dependency on the registrar
2025-03-25 18:59:25 -07:00
Saleem Abdulrasool
3bb8cfb475 Merge pull request #80251 from compnerd/workaround
Runtimes: add additional interface flags
2025-03-25 13:09:50 -07:00
Saleem Abdulrasool
c1dbc12587 Runtimes: establish dependency on the registrar
This removes the workaround for the exporting of the registrar and
enables proper dependency tracking across projects (primarily geared
towards the Overlay).
2025-03-25 10:12:31 -07:00
Evan Wilde
1dc97c2c43 [CMake] Use CXX linker for Core and Concurrency
swiftCore and swift_Concurrency libraries use C++ and Swift. The C++
does not use the Swift C++ interop. Swift driver only uses clang++ to
link when building in C++ interop mode and there currently isn't a flag
to change that. Since we're explicitly linking the runtime registration
when necessary and do not need compatibility libraries, it is safe to
use clang++ as the linker directly, instead of going through swiftc.

In versions of CMake older than 3.29, Swift is always used as a linker
and has no compile stage. By using clang++ as the linker, we require the
split build model (CMP0157), so we cannot allow versions of CMake older
than 3.29.
2025-03-24 14:20:07 -07:00
Saleem Abdulrasool
db51658e3f Runtimes: add additional interface flags
Explicitly add the path to the Swift module to the interface include
directories. It is unclear why this is not propagating implicitly from
the module definition. For now, this ensures that the client is able to
load the standard library.
2025-03-24 13:10:35 -07:00
Saleem Abdulrasool
f0b27bcd58 Merge pull request #80208 from compnerd/reorganise
Runtimes: reorganise flags for swiftCore
2025-03-24 13:07:48 -07:00
Guillaume Lessard
c21de062bb Merge pull request #78561 from glessard/rdar137710901-span-properties-prototype
[SE-0456] Span properties (part 1)
2025-03-24 08:47:47 -07:00
Saleem Abdulrasool
d19fd71174 Runtimes: reorganise flags for swiftCore
This re-organises the file a small amount to put the source listing and
additions together. Subsequently, apply compile definitions, options,
and then link libraries and finally options
2025-03-21 12:15:19 -07:00
Saleem Abdulrasool
bc45db16fd Runtimes: properly link in swiftrtT?.obj on Windows
`swiftrtT.obj` should be used for statically linking the standard
library (or within the standard library itself). For the other modules,
we need to differentiate between `swiftrt.obj` and `swiftrtT.obj`. This
fixes that oversight. This was not caught by the CI builds as we do not
currently build both the static and dynamic variants of the new
runtimes.
2025-03-20 11:07:46 -07:00
Alejandro Alonso
a55c9c792d Add EnumeratedSequence to new build system 2025-03-17 18:11:48 -07:00
Michael Gottesman
f64dd5a8d5 [concurrency] Add initial support for SwiftSettings to control defaultIsolation at the file level.
We introduce a new macro called #SwiftSettings that can be used in conjunction
with a new stdlib type called SwiftSetting to control the default isolation at
the file level. It overrides the current default isolation whether it is the
current nonisolated state or main actor (when -enable-experimental-feature
UnspecifiedMeansMainActorIsolated is set).
2025-03-10 17:33:45 -07:00
Guillaume Lessard
96e9945d10 [stdlib] only enable “AddressableTypes” for the core stdlib 2025-03-10 14:24:59 -07:00
Evan Wilde
7870db67f8 CMake: Runtime Installation Story
Starting to work on a full installation story for the Swift runtimes.
This involves generating the SwiftCoreConfig cmake files to allow
importing the just-built runtimes into the overlays and supplemental
libraries, setting up the flags appropriately for the given SwiftCore
build configuration.

This also separates out the development and runtime components to allow
installing just the runtimes without the headers.

Component List:
 - SwiftCore_runtime

  The runtime libraries that are required for running code.

 - SwiftCore_development

  The interface with the runtime libraries that are required for
  building code against the runtimes.

 - SwiftCore_cmake

  Files for interfacing CMake projects with the built runtimes.
  This includes the target list and flags needed to use the targets
  built by the specific configuration used to build the runtime
  libraries.

  These files are used for mapping flags, definitions, and locations
  into the overlay libraries and supplemental libraries.

This adds install commands for the object libraries contributing to
libswiftCore so that they are represented in SwiftCoreTargets.cmake.
Object libraries do not contribute anything to the files actually
installed.
2025-02-22 10:33:17 -08:00
Evan Wilde
e59326cdd5 CMake: Move installation of binary swiftmodule
To keep things consistent with the target and target-variant swiftmodule
files, moving the installation of the binary swift module into
`install_swift_interface`. CMake implicitly generates the target
swiftmodule, but does not know about zippered binaries, so we need to
ensure that the target-variant module is available for installation when
applicable.
2025-02-18 16:29:37 -08:00
Saleem Abdulrasool
509c385458 Runtimes: attempt to embed a SxS manifest for swiftCore
This will allow us to have multiple parallel installations of swiftCore
with the same DLL name allowing us to side-step the ABI instability
without resorting to SOVERSIONing.
2025-02-12 21:59:47 -08:00
Guillaume Lessard
c7af9a701b Merge pull request #79294 from Azoy/bye-bye-slab
[stdlib] Rename Slab to InlineArray
2025-02-12 12:03:25 -08:00
Eric Miotto
eb7706ded9 Merge pull request #79266 from edymtt/edymtt/rearrange-core-flags
Runtimes: rearrange flags to match the current stdlib
2025-02-11 13:02:58 -08:00
Alejandro Alonso
e4fb1f6761 Rename Slab to InlineArray 2025-02-11 10:26:44 -08:00
Saleem Abdulrasool
8733205cd5 Merge pull request #79269 from compnerd/closed
Runtimes: use the static module constructor in swiftCore
2025-02-10 14:23:25 -08:00
Saleem Abdulrasool
41b043ecfe Merge pull request #79227 from compnerd/implicit-explicit
Runtimes: remove the explicit linking in the build system
2025-02-10 13:09:55 -08:00
Eric Miotto
66d4665801 Runtimes: hoist more flags from swiftCore to all Core libraries
Addresses rdar://143152066
2025-02-10 13:06:44 -08:00
Eric Miotto
7924cc1a77 Runtimes: use -enable-experimental-concise-pound-file only for Core.
As per #32700, this is only meant for `Swift.swiftinterface`.

Addresses rdar://143152066
2025-02-10 13:06:44 -08:00
Saleem Abdulrasool
db4fd6dbee Runtimes: use the static module constructor in swiftCore
Use the static module constructor for swiftCore on Windows as the
runtime functions are internal to the module. This fixes the last linker
warning that we see with the standard library build when building
dynamically. More importantly, this allows building swiftCore as a DLL
with the new build system on Windows as we now treat any linker warnings
as errors.
2025-02-10 09:28:00 -08:00
Saleem Abdulrasool
c18d6bb7d1 Runtimes: remove the explicit linking in the build system
These libraries are now implicitly explicitly linked. The source files
include `#pragma comment(lib, ...)` to include the autolink directives
to properly handle the dependency propagation to ensure static linking
is sufficiently closed.
2025-02-07 14:14:39 -08:00
Eric Miotto
2a367234be Runtimes: support generic metadata prespecialization for all of Core
Also provide a flag to enabled/disable it.

Addresses rdar://144255917
2025-02-07 07:39:21 -08:00
Evan Wilde
a9da4a5c1a CMake: Add install platform and architecture subdirs
In some configurations, libraries are installed under
`<install-prefix>/{libdir}/swift/<platform>/<arch>` and module content
is installed under `<install-prefix>/{libdir}/swift/<platform>`.

This also accounts for the fact that Swift currently looks under
`<install-prefix>/{libdir}/swift_static/**` for the static stdlib
builds.
2025-01-23 12:25:21 -08:00
Justice Adams
d1d8cdd170 add SwiftifyImport.swift to source list (#78785) 2025-01-22 13:53:21 -08:00
Eric Miotto
0c33858e74 [CMake] Avoid using a couple flags when building MinSizeRel
This preserves the behaviour introduced in #33444.

Addresses rdar://142820419
2025-01-15 14:41:49 -08:00
Evan Wilde
c92e1d7904 CMake: SwiftCore: Get Slabs building
This patch adds slabs to the new stdlib build system.
2025-01-13 13:27:58 -08:00
Saleem Abdulrasool
ce3cc37e83 Merge pull request #78504 from compnerd/globals
Runtimes: adjust global flags in preparation for extending the Core project
2025-01-09 19:02:38 -08:00
Saleem Abdulrasool
43487a35a9 Runtimes: extract and hoist "global" flags
These set of Swift flags are applied to all runtime libraries that are
built. Hoist them to the top-level to spell them once and to keep all
the libraries in sync.
2025-01-08 15:35:23 -08:00
Saleem Abdulrasool
654577bb36 Runtimes: correct generator expression language spelling
This corrects the compile language check in the generator expression to
add the missing `X`.
2025-01-08 15:04:30 -08:00
Saleem Abdulrasool
cec890dcdc Runtimes: merge target_link_libraries (NFC)
This simply merges two calls to `target_link_libraries` into a single
call as both are using the same visibility.
2025-01-06 14:23:15 -08:00
Justice Adams
31b6aee3b8 include Span files (#78295) 2024-12-19 13:05:34 -08:00
Justice Adams
4666a418e0 [CMAKE] Add Plist creation to swiftCore (#77960)
* update Resync to copy plist template

* include Plist in linked library for Darwin platforms

* only embedd plist on apple platforms

* formatting fix
2024-12-17 15:49:54 -08:00
Evan Wilde
0a9ab413a0 Merge pull request #78175 from etcwilde/ewilde/stdlib-rebuild-swiftcore-vendor-extension
[CMake] Add build-system vendor hook for swiftCore
2024-12-16 09:56:07 -08:00
Saleem Abdulrasool
f68fed2562 Merge pull request #78179 from compnerd/unregistered
runtime: avoid the toolchain Swift registrar
2024-12-16 08:09:17 -08:00
Justice Adams
cf307da872 [cmake] add -headerpad_max_install_names when building dylibs (#78121)
* add -headerpad_max_install_names when building dylibs

* fix formatting of link options
2024-12-13 14:47:22 -08:00