Commit Graph

12 Commits

Author SHA1 Message Date
Daniel Rodríguez Troitiño
42e43edef3 [cmake] Unify usage of create_symlink/copy across the build files. (#72202)
In several places, there was the same or similar code to either do
a symlink or use copy/copy_if_different/copy_directory in Windows
systems. The checks were also slightly different in some cases.

There is a `SWIFT_COPY_OR_SYMLINK` that can be controlled as a CMake
option, and uses `CMAKE_HOST_UNIX` as default. Change all cases that
I can find to use that value. Also create a parallel value
`SWIFT_COPY_OR_SYMLINK_DIR` to apply to directories.

There is still a couple of cases that are specific to macOS SourceKit
framework which I have left as-is, since symlinks is probably the only
right thing to do there.

There's a case for Windows specifically that uses symlinks (in
523f807694/cmake/modules/SwiftConfigureSDK.cmake (L502))
which I have not modified as well.
2024-03-09 18:03:55 -08:00
Stéphan Kochen
7b460ce495 build: fix accidental cmake expansions
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:

- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
  expands to 1, where it would previously coerce to a string.

- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
  left-hand side expands twice.

In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:

- Quoted right-hand side of `STREQUAL` where I was confident it was
  intended to be a string literal.

- Removed manual variable expansion on left-hand side of `STREQUAL`,
  `MATCHES` and `IN_LIST` where I was confident it was unintended.

Fixes #65028.
2023-07-17 21:50:50 +02:00
Daniel Rodríguez Troitiño
970c030d19 [cmake] Rename swift-api-digester to its new name. (#37937)
In #36381 the swift-api-digester changed from being a standalone tool to
be a symlink of the frontend. With the symlink, the target
swift-api-checker disappeared. In order to keep depending on
symlink_abi_checker_data for the tests, change the mentions of
swift-api-checker to swift-frontend (which is the actual target that
creates the symlink).
2021-06-16 15:07:10 -07:00
Jordan Rose
998d2ed739 [CMake] Include API checker nil baseline even when not building all (#27098) 2019-09-10 09:26:26 -07:00
Xi Ge
75b3dfb865 cmake: using PROGRAMS instead of providing permission bits for swift-api-checker.py 2019-09-06 17:14:49 -07:00
Xi Ge
1d5aaa8509 cmake: ensure swift-api-dhecker.py is executable in the toolchain 2019-09-06 14:52:29 -07:00
Xi Ge
4f7ade9e8a cmake: symlink framework ABI baseline data into the build directory
When running the ABI checker from the build artifact, the executable
should be able to find baselines in the same relative paths as if
it's running from a toolchain.
2019-08-30 14:44:15 -07:00
Xi Ge
6e45f89381 cmake: set up installing framework ABI baselines into toolchain 2019-08-22 17:00:29 -07:00
Xi Ge
f7881eed66 cmake: specify only one component toolchain-tools for swift-api-digester 2019-05-14 15:04:11 -07:00
Alex Langford
3d9a28925b [CMake] Modify swift_install_in_component to support cmake install components
CMake supports the notion of installation components. Right now we have some
custom code for supporting swift components. I think that for installation
purposes, it would be nice to use the CMake component system.

This should be a non-functional change. We should still only be generating
install rules for targets and files in components we want to install, and we
still use the install ninja target to install everything.
2019-04-19 14:06:11 -07:00
Xi Ge
db0f39fc9a cmake: install swift-api-digester and swift-api-checker into the OSS toolchain. SR-10220 2019-03-29 11:47:17 -07:00
Xi Ge
5c0013e371 cmake: install swift-api-checker into the tools component. 2019-03-20 11:24:33 -07:00