118ab41984 Swift: Build with a package name by default
94faee3099 Swift: Add option to pass package name to swiftc invocation
635f71737c Swift: Factor out Swift-specific target flags
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11981
da33d606e6 PellesC: Add support for C language standards
8e76e3c827 Tests/CompileFeatures: Add support for testing without CXX
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11982
GetSwiftModuleName() returns the target name verbatim when
Swift_MODULE_NAME is not set, but hyphens are not valid in Swift
module identifiers. Replace them with underscores so that targets
like swift-syntax get module name swift_syntax automatically.
Issue: #27748
Since commit b6367f723b (Swift/Ninja: Emit modules separately from
compilation, 2026-04-10) the compile edge still appends
-emit-module -emit-module-path when emitModuleSeparately is active,
duplicating the emit-module edge. For targets with directory-style
module paths (CMP0195=NEW), this causes a file/directory conflict
that fails the build.
Guard -emit-module -emit-module-path on both the compile and
emit-module edges so they are not appended when the flags already
contain -emit-module-path (e.g. from the target's compile options).
Discovered building swift-syntax on Windows where the directory-style
path was overwritten by the flat path from the compile edge.
Issue: #27748
Swift started the trend of piling language-specific target flags in
`cmLocalGenerator::AddLanguageFlags`. Other languages have added their
own under language-specific `Add<Lang>TargetFlags`.
I'm refactoring where Swift piles on its language-specific target flags
to match the pattern other languages are using.
The cmPkgConfigEnv* of cmPkgConfigResult would point
to a deleted stack copy.
This can causes issues when cmPkgConfigResult::Libs()
is called and we have to fall back to querying the
env.
Backport libarchive commit `1f5454575f` (cab reader: Fix use of
uninitialized values from Huffman, 2026-04-23).
Add a fuzzing test case to expose this to dynamic analysis tools.
Add policy CMP0215 to emit `.swiftmodule` from a dedicated `-emit-module`
build edge for importable Swift targets in the Ninja generator.
Downstream targets can begin compiling as soon as the module interface
is ready, overlapping with upstream object compilation and linking.
When CMP0215 is NEW and CMP0157 is NEW, separate module emission is
enabled by default. The `Swift_SEPARATE_MODULE_EMISSION` target
property (initialized by the `CMAKE_Swift_SEPARATE_MODULE_EMISSION`
variable) can override this per target.
The compile edge still passes `-emit-module` so that swiftc continues
to produce `.swiftdoc`; only the `.swiftmodule` output moves to the new
edge.
Also fix swiftmodule dependency edges in cmNinjaNormalTargetGenerator
to use IsLanguageUsed instead of GetLinkerLanguage, so C/C++ targets
whose linker language propagated to Swift do not produce spurious
implicit dependencies.
Closes: #27748
Rewrite the function that updates the diagnostic state from presets to
apply all modifications concurrently. Previously, we applied all
warnings, then all errors, which (because changes are recursive) could
result in an enabled error for a parent diagnostic overriding a disabled
warning for a child diagnostic.