This fixes using --install-swift on macOS when not building all of the
variant stdlibs (e.g. iphonesimulator, etc.).
When we build swift on macOS, by default we build only the macOS stdlib.
The other stdlib variants are still configured and there are targets to
build them if you e.g. run `ninja swift-stdlib-iphonesimulator-x86_64`
manually. However, we do not separate the _install_ actions. This
meant that you couldn't install without building all the configured
stdlib variants.
...because the Darwin overlay is responsible for installing them.
Context: Within Apple, overlays are sometimes built separately from
the rest of the Swift project. This doesn't currently work with just
the public repo (rdar://problem/47324189), but it could, and I broke
it with my recent API notes cleanup. This should get things working
again.
rdar://problem/47294352
Previously, build-script-impl would set this to "" by default, resulting
in nothing being installed with --install-swift unless you explicitly
set --swift-install-components as well. Now we defer to cmake by
default.
On the cmake side, change the default value to exclude
* dev - uses a lot of disk space and usually not something you want to
install into a toolchain
* clang-resource-dir-symlink & clang-builtin-headers-in-clang-resource-dir -
these are mutually exclusive with clang-builtin-headers
* sourcekit inproc/xpc - these are currently mutually exclusive, so pick
the best one for the current platform.
They're all the same anyway, and no longer even need to be compiled,
just copied in as text.
And drastically simplify how we "generate" them. Instead of attaching
their build jobs to the appropriate overlays, if present, "just" have
one job to copy them all and attach it to the Darwin overlay. That's
what we do for the overlay shim headers, and it's good enough.
(Eventually we want to get out of the business of shipping them
altogether.)
This does have the same flaw as the shim headers: if you /just/ change
API notes, the corresponding overlay does not get rebuilt. You have to
touch that too. But in practice that'll happen most of the time
anyway.
Part of rdar://problem/43545560
Colocate the target specific library specification. Inline the single
site use of the place holder ICU_UC and ICU_I18N libraries rather than
trying to create special library processing code for that.
Windows does not support fat binaries, so the target specific components should
be placed into the architecture subdirectory. Due to the cross-compilation
model that swift has, this needs to be added explicitly for now.
This improves the integration with LLVM and the unified build. The
LLVM_INSTALL_TOOLCHAIN_ONLY flag ensures that the the development libraries are
not installed. Because this option is not defined by default, the beahavioural
changes here are not triggered by default.
This converts the path separators to the CMake way. This is primarily
important for Windows where the path separator is \ rather than /. This
conversion allows the specification of the path in the proper windows
path style.
The initial configure & generate of a build on Windows should have
the necessary VCVARS set in the environment. After that, we should be
incrementally building with those same vars to avoid conflicts between
Windows SDKs.
Cache these vars so that the same Windows SDKs are consistently used
in future incremental builds.
Due to the horrible attrocities against software of the attempt to perform
cross-compilation in the swift build system, we need to emulate the linking
behaviour for Windows with the link against the import library. The emulation
requires the custom creation of import library targets. In order to actually
get the linking semantics correct, the dependendency targets must be created
prior to use (unlike standard CMake). The reordering ensures that we get
correct linkage when building for Windows.
Perform a simple optimization to avoid a number of string comparisions for the
host system.
Normally, the C++ shared library would have link against the C++ ABI
shared library, but the Android NDK does not distribute the later, so
one need to link manually against the static C++ ABI from the NDK.
This will ensure that additional target executables can not be added to the rest
of the swift project without anyone noticing since the non-stdlib parts of
Swift's cmake will not have visibility of the declaration unless they change the
cmake lookup paths.
`-fblocks` is a core driver option now, so it can be used with both the GCC
style driver as well as the cl style driver. Simplify the logic for the
handling of this option.
The swift image registrar uses the extension `.obj` as is traditional on
Windows. Ensure that we get the extension correct when cross-compiling with the
Swift specific cross-compilation system.
The Android targetted libraries already link (manually) with the Android
NDK C++ libraries. When using Clang and lld, an extra link to libc++ is
requested, which will fail because Android names it libc++_shared.so
instead. To avoid looking for the wrong name, and since the library is
referenced manually either way, request no linking with the standard C++
libraries (but add the math library in, which is implicitly linked when
C++ is linked, and it is needed for Glibc at least).
Ensure that the use the target specific names for the fat libraries for
non-MachO targets which do not support fat libraries. This fixes the
windows build.
Attempt to repair the build for the unified swift build. This allows us
to build a single unified toolchain with swift support. In this layout
assume that cmark and clang are peers of LLVM rather than located in
`tools`. Doing so allows a uniform layout of the tree and a simpler
build approach.
gold is more strict than lld about the order of the arguments, that's
why CMake offers two different properties for the linker: LINK_FLAGS and
LINK_LIBRARIES. The former _add_variant_link_flags was adding the
libraries to LINK_FLAGS, when the correct thing is to add them to
LINK_LIBRARIES.
The change adds a new output variable for _add_variant_link_flags which
will containt the linked libraries, and CMake will be able to generate
the correct command line invocation for when gold is used.
This should fix the Android CI build.
Windows does not link against the library but the import library. When
building the target specific bits, we unfortunately do not use the cmake
build infrastructure properly. This results in us trying to link
against libraries which do not exist. Redirect the link to the right
files. This allows us to build swift-reflection-test.