build-script: allow `--test-wasm-stdlib` without `--build-wasm-stdlib`
This allows testing Wasm stdlib without fully rebuilding WASI sysroot and stdlib, while changes to stdlib itself are still detected by ninja as dependencies and are built incrementally, which is great for local builds.
Install static XCTest library and its Swift module files in the following
directory structure:
```
usr/lib/swift_static/wasi/libXCTest.a
usr/lib/swift_static/wasi/XCTest.swiftmodule
```
Xcode puts clang command line arguments in a single line in .resp files.
Split the argument printing routine into its own function print_arg.
When a clang response file is encountered, split each line into arguments and loop them through print_arg.
-c has an argument for clang
wasm-run.py: consistent `wasmkit` path with `build_runtime_with_host_compiler`
When passing `--build-runtime-with-host-compiler` there's no such executable `wasmkit-cli` in the host toolchain, where it's named `wasmkit` when installed. Let's make that consistent to make it work in both cases.
Fix type error in `should_test_executable`:
```
reportIncompatibleMethodOverride: Method "should_test_executable" overrides class "WasmStdlib" in an incompatible manner
Return type mismatch: base method returns type "Literal[True]", override returns type "Literal[False]"
"Literal[False]" is not assignable to type "Literal[True]"
```
Adding a preset for building the FreeBSD toolchain and runtime package.
This is very similar to the Linux package build, but the main difference
is the lack of WASM build. The WASM runtime build system uses GNU
extensions in its makefiles that are not compatible with the make or
gmake on FreeBSD and therefore cannot be built there.
This allows testing Wasm stdlib without rebuilding WASI sysroot and stdlib, while some changes are still detected by ninja as dependencies and are rebuilt, which is great for local incremental builds.
When passing `--build-runtime-with-host-compiler` there's no such executable `wasmkit-cli` in the host toolchain, where it's named `wasmkit` when installed. Let's make that consistent to make it work in both cases.
build-presets.ini: add `wasm_stdlib,macos` for at-desk development
There are no non-incremental presets currently available for macOS in `build-presets.ini`, and existing non-incremental presets only cross-compile to Wasm on Linux. Let's add one for macOS to make development on that platform easier.
There are no non-incremental presets currently available for macOS in `build-presets.ini`, and existing non-incremental presets only cross-compile to Wasm on Linux. Let's add one for macOS to make development on that platform easier.
We should eventually split these, but for now SWIFT_COMPILER_VERSION
matches SWIFT_TOOLCHAIN_VERSION when it's actually set. Just use it in
preference to SWIFT_TOOLCHAIN_VERSION.
This allows quickly building WASI sysroot when `--skip-build-llvm --skip-build-swift --build-runtime-with-host-compiler --build-wasm-stdlib` combination of options is passed to `build-script`.
This LLVM tool is required for cross-compiling and debugging binaries cross-compiled to non-Darwin platforms, but for some reason is currently not included unlike `llvm-ar` or `llvm-ranlib`.
This allows quickly building `WasmLLVMRuntimeLibs` product with the host toolchain (usually Swift nightly development snapshot toolchain) when `--skip-build-llvm --skip-build-swift --build-runtime-with-host-compiler` combination of options is passed to `build-script`.
Add several clang flags that don't show up in its --help (many are cc1 flags).
Add a heuristic that if an argument doesn't start with a '-' then it's an argument parameter.
Special case -finclude-tree-preserve-pch-path as not an argument that has a parameter.
This allows quickly building WASI-libc and Swift stdlib with WASI when `--skip-build-llvm --skip-build-swift --build-runtime-with-host-compiler` combination of options is passed to `build-script`.