Commit Graph

13 Commits

Author SHA1 Message Date
Hamish Knight
56178cd97c [xcodegen] Allow absolute path for output in compile commands
Looks like in newer versions of CMake this can be an absolute path.
2025-08-12 15:04:28 +01:00
Hamish Knight
1c99ddc1e9 [xcodegen] Make sure to realPath Clang file paths
Ensure we get the `realPath` for file paths in the
`compile_commands.json` to canonicalize casing.
2025-06-17 12:58:34 +01:00
Hamish Knight
27ec6e3a45 [xcodegen] realpath Swift target sources
Make sure we call `realpath` for the Swift target sources read from
the build settings to ensure we canonicalize their casing.
2025-06-15 20:29:17 +01:00
Hamish Knight
71d367a7d9 [xcodegen] Remove duplicate file check from tryAddTarget
I don't recall why I added this, a file can be in multiple targets
and xcodegen handles that case just fine.
2025-05-07 13:48:45 +01:00
Hamish Knight
a404893f26 [xcodegen] Ignore -fdiagnostics-color
Avoid introducing ANSI escape sequences in the Xcode build log.
2025-05-07 13:48:45 +01:00
Hamish Knight
abc099cfa9 [xcodegen] Match common prefix in CommandArgTree
Rather than forming a set intersection, only look for a common prefix
with the parent arguments. This is both quicker and more correct
since arguments can be order-dependent. This does mean we'll end up
with more per-file arguments for "umbrella" targets, but that at
least will no longer prevent us from forming buildable folders for
them.
2025-05-07 13:48:45 +01:00
Rintaro Ishizaki
8d2ac00015 [XcodeGen] Handle 'rule' declarations and generate command line args
* Rename 'BuildRule to 'BuildEdige' because it is the official term
* NinjaParser to handle 'include' and 'rule' directives
* NinjaParser to handle parse "rule name" in 'build' correctly
* Make variable table a simple `[String: String]` and keep any bindings
  to make the substitutions possible.
* Generate command line argumets using 'command' variable in the 'rule'
  and use it as the source of truth, istead of using random known
  bindings like 'FLAGS'.
2025-01-28 10:07:17 -08:00
Hamish Knight
38c1d28197 [xcodegen] Fix hasPrefix for paths
The intention here was to do a component-wise
prefix check, not sure why I did a string prefix
check. Switch to component prefix and rename to
`starts(with:)` to match `FilePath`.
2025-01-02 15:06:24 +00:00
Hamish Knight
a7b34855ed [xcodegen] Allow swift-plugin-server to be added
Previously we would avoid adding this since it has
an invalid module name, but we can follow the same
logic as the driver and set the module name to
`main`.
2024-12-15 18:31:49 +00:00
Hamish Knight
780a546646 [xcodegen] Restrict dependency computation a bit
Only consider `.o` and `.swiftmodule` inputs for now. Previously
we could end up with unnecessary dependencies for e.g plugin
dylibs, but we don't build and patch those in currently.
2024-12-14 19:53:51 +00:00
Hamish Knight
9a53db6b9a [xcodegen] Add --buildable-folders
This enables the use of folder references for
compatible targets, allowing new source files to
be added without needing to regenerate the project.
Currently disabled by default; I'd like to get
some living-on before enabling.
2024-11-09 20:16:45 +00:00
Hamish Knight
43be5456b1 [xcodegen] Allow output to be missing in compile_commands.json
This may not always be present for CI builds.
2024-11-06 12:20:44 +00:00
Hamish Knight
03d8ea5248 Introduce swift-xcodegen
This is a tool specifically designed to generate
Xcode projects for the Swift repo (as well as a
couple of adjacent repos such as LLVM and Clang).
It aims to provide a much more user-friendly experience
than the CMake Xcode generation (`build-script --xcode`).
2024-11-05 22:42:10 +00:00