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
`--buildfiles` is what keeps these files **out of the repository root**. mcpp is
428
+
built by mcpp; a CMakeLists.txt and an xmake.lua at the root are files every
429
+
contributor has to learn to ignore, and one of them actively broke something:
430
+
`scripts/bootstrap-macos.sh` generates its own root `xmake.lua` when none is
431
+
present, and a bench-owned file at that path silently pre-empted it. cmake is
432
+
pointed at the directory with `-S`, xmake with `-P`; mcpp reads the project's
433
+
own manifest and ignores the flag. Copying the descriptions into the tree for
434
+
the duration of a run was the alternative, and it writes into the user's
435
+
repository, which this harness refuses to do.
436
+
437
+
| engine | builds mcpp? |
438
+
|---|---|
439
+
| mcpp | yes — it is mcpp's own manifest |
440
+
| cmake 4.0.2 | yes — needs `CMAKE_CXX_MODULE_STD 1` and the CMake-4.0 experimental UUID |
441
+
| xmake 3.0.7 | yes |
442
+
| meson 1.10.2 | no — no way to declare an interface unit, and no `import std;`|
443
+
| bazel 9.2.0 | not in the gcc table. `import std;`**is** buildable (libc++ ships the std module as ordinary source — see `bench/projects/mcpp/MODULE.bazel` for the working recipe), but bazel's modules need clang, so a bazel column belongs in a clang-baselined table or it breaks invariant I1 |
444
+
445
+
### The cmake description has two traps worth knowing
446
+
447
+
***`FILE_SET CXX_MODULES` requires every file under a base directory.** The
448
+
`mcpplibs.cmdline` dependency lives in the registry, outside the tree, so it
449
+
needs its own file set with an explicit `BASE_DIRS`.
450
+
***`add_compile_options()` does not reach the `std` module.** CMake generates
451
+
that target itself, so directory-scope options miss it: the std module then
452
+
compiles against the compiler's default libc headers while every mcpp unit
453
+
compiles against `--sysroot`, and the build dies on a type that exists in both
454
+
(`conflicting type for imported declaration 'char _IO_FILE::_unused2 [20]'`).
455
+
The error names neither the flag nor the target that is wrong. Use
456
+
`CMAKE_CXX_FLAGS`.
457
+
458
+
The xmake description pins the compiler by reading `[toolchain] default` out of `mcpp.toml`, because
417
459
the registry holds several GCCs and "newest directory wins" only *happens* to
418
460
agree with the pin. Verify before quoting anything from it:
419
461
420
462
```bash
421
-
xmake f -y -m release --toolchain=mcpp-gcc
422
-
xmake show -t mcpp | grep 'compiler (cxx)'# must be the same binary mcpp uses
463
+
xmake f -P bench/projects/mcpp -y -m release --toolchain=mcpp-gcc
464
+
xmake show -P bench/projects/mcpp -t mcpp | grep 'compiler (cxx)'# must be mcpp's binary
423
465
```
424
466
425
467
> An earlier revision called `set_toolchains()` unconditionally, which silently
0 commit comments