You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build: add an initial CMake based build system for DocC (#818)
* build: add an initial CMake based build system for DocC
This allows us to cross-compile DocC and reduce the size of the binary
by sharing the toolchain artifacts.
* Update CONTRIBUTING.md
Co-authored-by: David Rönnqvist <ronnqvist@apple.com>
---------
Co-authored-by: David Rönnqvist <ronnqvist@apple.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -350,7 +350,32 @@ by running the test suite in a Docker environment that simulates Swift on Linux.
350
350
cd swift-docc
351
351
swift run docc
352
352
```
353
-
353
+
354
+
## Updating Build Rules
355
+
356
+
In order to build DocC as part of the Windows toolchain distribution uniformly,
357
+
a parallel CMake based build exists. Note that this is **not** supported for
358
+
development purposes (you cannot execute the test suite with this build).
359
+
360
+
CMake requires that the full file list is kept up-to-date. When adding or
361
+
removing files in a given module, the `CMakeLists.txt` list must be updated to
362
+
the file list.
363
+
364
+
The 1-line script below lists all the Swift files in the current directory tree.
365
+
You can use the script's output to replace the list of files in the CMakeLists.txt file for each target that you added files to or removed files from.
366
+
367
+
```bash
368
+
python -c "print('\n'.join((f'{chr(34)}{path}{chr(34)}' if ' ' in path else path) for path in sorted(str(path) for path in __import__('pathlib').Path('.').rglob('*.swift'))))"
369
+
```
370
+
371
+
This should provide the listing of files in the module that can be used to
372
+
update the `CMakeLists.txt` associated with the target.
373
+
374
+
In the case that a new target is added to the project, the new directory would
375
+
need to add the new library or executable target (`add_library` and
376
+
`add_executable` respectively) and the new target subdirectory must be listed in
377
+
the `Sources/CMakeLists.txt` (via `add_subdirectory`).
378
+
354
379
## Continuous Integration
355
380
356
381
Swift-DocC uses [swift-ci](https://ci.swift.org) infrastructure for its continuous integration
0 commit comments