If we do an external benchmark build, we will do it via the toolchain benchmark
build-script job. This will be simpler by allowing us to build against a just
built toolchain and separate us from the rest of swift's main CMakeLists.txt.
Add dependencies on the files for gyb to ensure that updates gyb are
treated as triggers to regenerate the files. This is suspected to have
caused issues for incremental builds.
This flag does not make sense here as this function is called from
`_add_host_variant_link_flags` and `_add_host_variant_c_compile_flags`.
The latter will add the flags appropriately. The former is always
invoked *after* `_add_host_variant_c_compile_flags`. This effectively
was duplicating the flags.
Rather than defaulting both of these to true, enable gold by default
only on ELFish targets, and enable LLD by default for Windows on
non-Windows hosts.
The toolchain does not actually use any catalyst flavor, which resulted
in these paths actually being dead. Cull them except for the one path
which simply computes the target triple.
This is just a cleanup of the implementation of
`add_swift_host_library`, reorganizing the flag computation and
application as well as the property setting.
This function is used at one site and is an internal function. Host
libraries are always built in a single configuration, just inline it to
avoid unnecessarily reparsing arguments.
The standard library (and other Swift modules built by our CMake build system)
has been building module files with an architecture only (e.g., x86_64.swiftmodule)
rather than a proper module triple (x86_86-apple-macosx10.15,
x86_64-apple-ios13.0-simulator, etc.), unlike every other build
system. There are hacks in the compiler and other tools to cope with
this unnecessary build difference. Fix the module file names so we'll
be able to remove the hacks later.
Fixes rdar://problem/49071536.
Use a newly introduced `swift_gyb_target_sources` to gyb and use the
generated sources when building. Let CMake figure out when to run the
command, let it invoke the command properly, and indicate that the
sources being added to the target are generated.
The two invocations here both had a single parameter passed to it.
Replace it with `add_dependencies` which already actually supports
multiple dependencies specified. Sink the custom wrapper into the
usage location in `AddSwiftStdlib.cmake`.
The host tools do not use ICU, only the standard library does. Remove
the special handling in the host tool path for ICU. This simplifies the
flag computation and allows the ICU handling to be sunk entirely into
the target specific paths.
Convert the out parameters for `_add_host_variant_c_compile_flags` to
use the target as an in-parameter. Doing so allows us to set the
properties on the target directly rather than providing them as out
parameters which then get set subsequently.
Convert the out parameters for `_add_host_variant_link_flags` to use the
target as an in-parameter. Doing so allows us to set the properties on
the target directly rather than providing them as out parameters which
then get set subsequently.
Perform some constant folding, constant value propagation, dead argument
elimination over the flag computation methods. This reduces the
unnecessary parameters and more clearly and succinctly describes what is
happening.
Apply constant value propagation to the host flag variant operations.
This reduces the parameters needed for the invocations and enables
further cleaning in the hopes that we can apply these per-target using
CMake instead.
Merge the single use `_add_swift_host_executable_single` into the
singular site. The host tools are built in a single variant. This
avoids the custom logic for adding multiple variants. Folding this
away will allow further simplifications in order to move towards a
standard CMake build.
Remove some unused parameters for this function. This simplification
will make it easier to merge `_add_swift_host_executable_single` into
`add_swift_host_executable`.
The build systems that drive Swift compilation have been using the
"simulator" environment as part of the increasingly inaccurately
named "target triple" to specify simulator targets for several
years... except our own hand-rolled build system. Identify
simulator targets and append "-simulator" to their target
triples.
Commit for CMake and build scripts to recognize OpenBSD. To keep this
commit relatively short, this just deals with the rather simple and
uncontroversial changes to the build system.
Note that OpenBSD calls "x86_64" as "amd64", Since the Swift stdlib will
be put in a subdirectory named after ARCH, to ensure the standard
library is properly found later, we use the native architecture name for
OpenBSD in the build system rather than trying to deal with the
difference the other way around.
After noticing that also in CMake 3.16 the LINKER: prefix is not
expanded correctly when used in `target_link_options`, prefer to set the
linker parameters in a more verbose way and leave a comment behind on
when this behavior was observed in case we want to change the
implementation later.
Follow up to #29636.
Addresses rdar://problem/59732421
Remove anachronistic check for a "blanket" module map in
/System/Library/Frameworks from Darwin SDK configuration. We already
extract other information from the SDK that we actually need, so check
for that directly instead.
Fixes rdar://problem/60084609.
This is a purely code motion change. It moves the functions that are
specific to `SwiftSource.cmake` into `SwiftSource.cmake`. Target
functions are moved to `stdlib/cmake/modules/AddSwiftStdlib.cmake`.
Now that `_add_swift_host_library_single` only deals with host
libraries, it is no longer mutating the name of the library target.
This `set_target_property` is no longer needed.
This reverts commit beb8ecd8cc. Add a
workaround for the dependency issue.
It is unclear why `sourcekitd` is getting added improperly as a
dependency on `lib/sourcekitd.framework/sourcekitd`. This workaround
adjusts the dependency such that we end up with a dependency on
`lib/sourcekitd.framework/Versions/A/sourcekitd` as an order-only
dependency. This should fix the compile issue. I am unable to
reproduce this issue with the `add_library` usage for adding a Swift
library. This allows us to cleave the host and target libraries, and so
the workaround is sufficient to make progress and the problem will be
resolved with the migration towards CMake for handling the dependencies.