8 Commits
Author SHA1 Message Date
Evan Wilde 23b33482f1 Swift: Refactor module / object builds
Splitting up the computation of common variables, module build
variables, and object build variables to make it a little easier to
focus on each one.

Updated tests to reflect updated flag order and updated object-build
description.
2026-08-14 17:02:20 -07:00
Roman Lavrov 0f20ba5b68 Ninja: Swift: Extract helpers and reorder module flags
Extract SetupResponseFile and ExpandRuleCommands helpers from
WriteCompileRule to allow reuse by new rule types.

Reorder flag appending in WriteSwiftObjectBuildStatement so that
-module-name and -module-link-name precede -emit-module, preparing
for a separate emit-module edge that shares common flags.  Update
test regexes accordingly.

Issue: #27748
2026-04-24 10:17:11 -04:00
Robert MaynardandBrad King d314cad7f1 Ninja,Make,FASTBuild: Avoid unnecessary Windows short paths in placeholders
Only the classic Borland `make` and Watcom `wmake` tools need short paths.

Co-authored-by: Brad King <brad.king@kitware.com>
Fixes: #16138
2026-02-24 11:56:23 -05:00
AJIOB 5de7a09e77 Tests/RunCMake: Match dots more precisely, part 3 2025-10-20 14:45:24 -04:00
Evan Wilde e1d635e71c Swift: Expand generator expressions in Swift_MODULE_DIRECTORY
This patch makes the `Swift_MODULE_DIRECTORY` property behave more like
the other output directory properties, allowing generator expressions
and fixing the behavior with multi-config generators.

Issue: #26010
2024-12-09 10:37:05 -08:00
Evan Wilde 8669176576 Swift: Fix INSTALL_NAME_DIR under CMP0157 NEW behavior
Setting `CMAKE_INSTALL_NAME_DIR` or the `INSTALL_NAME_DIR` on Swift
targets had no effect when CMP0157 was set to `NEW`.  This was a result
of missing the `<TARGET_INSTALLNAME_DIR>` before the `<TARGET_SONAME>`.
Fix that and add a test to verify that the install name directory is
included in the install name.

Fixes: #26175
2024-08-01 10:49:36 -04:00
Evan Wilde f292e28b84 Swift: Ninja: Pass module name to all swift builds
Executables that don't export a public API should not emit a
swiftmodule, but the swift modulename is observable from within the
program, so we should still set the module name on executable builds.

Fixes: #25710
2024-02-23 11:12:05 -05:00
Saleem Abdulrasool 9e829779f2 Swift: preserve -static for static library swiftmodules
The `-static` is important for the emission of the module as it is
serialized into the swiftmodule which then is used by the Swift frontend
to decide how to link to the symbol (via the GOT or not, or the IAT on
Windows). This repairs building static libraries with Swift on Windows.
2024-01-09 09:13:34 -08:00