Skip to content

Commit ac4cbff

Browse files
authored
test(build-mcpp): use the typed import mcpp; module (Clang CI coverage) (#60)
* test(build-mcpp): use the typed import mcpp; build module (Clang CI coverage) Converts the build-mcpp member's build.mcpp to import mcpp; (modules-first; textual #include only for file I/O). On macOS/Windows the workspace job runs this under clang, exercising the import-mcpp Clang module path. Needs mcpp >= 0.0.81. (held until 0.0.81 is released) * ci: bump mcpp 0.0.79 -> 0.0.81 (typed import mcpp; for build-mcpp member)
1 parent f6d3d70 commit ac4cbff

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/validate.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
env:
1414
# Bumped to 0.0.78: carries L3 build.mcpp native build program (build-mcpp member),
1515
# compat.openblas Windows recipe (bin/libopenblas.dll staged beside the .exe).
16-
MCPP_VERSION: "0.0.79"
16+
MCPP_VERSION: "0.0.81"
1717

1818
jobs:
1919
lint:
@@ -111,20 +111,20 @@ jobs:
111111
include:
112112
- platform: linux
113113
os: ubuntu-latest
114-
archive: mcpp-0.0.79-linux-x86_64.tar.gz
115-
root: mcpp-0.0.79-linux-x86_64
114+
archive: mcpp-0.0.81-linux-x86_64.tar.gz
115+
root: mcpp-0.0.81-linux-x86_64
116116
mcpp: bin/mcpp
117117
xlings: registry/bin/xlings
118118
- platform: macos
119119
os: macos-15
120-
archive: mcpp-0.0.79-macosx-arm64.tar.gz
121-
root: mcpp-0.0.79-macosx-arm64
120+
archive: mcpp-0.0.81-macosx-arm64.tar.gz
121+
root: mcpp-0.0.81-macosx-arm64
122122
mcpp: bin/mcpp
123123
xlings: registry/bin/xlings
124124
- platform: windows
125125
os: windows-latest
126-
archive: mcpp-0.0.79-windows-x86_64.zip
127-
root: mcpp-0.0.79-windows-x86_64
126+
archive: mcpp-0.0.81-windows-x86_64.zip
127+
root: mcpp-0.0.81-windows-x86_64
128128
mcpp: bin/mcpp.exe
129129
xlings: registry/bin/xlings.exe
130130
steps:
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Native build program: generate a source the test links + define a macro the
2-
// test sees. mcpp compiles+runs this (cwd = project root) before the build.
1+
// Modules-first build program: import mcpp; for the typed directive API. A textual
2+
// #include is still fine for file I/O (only `import std;` is unnecessary).
33
#include <filesystem>
44
#include <fstream>
5-
#include <cstdio>
5+
import mcpp;
66
int main() {
77
std::filesystem::create_directories("src");
88
std::ofstream("src/generated.cpp") << "int answer() { return 42; }\n";
9-
std::puts("mcpp:generated=src/generated.cpp");
10-
std::puts("mcpp:cxxflag=-DBUILT_BY_BUILD_MCPP=1");
11-
std::puts("mcpp:rerun-if-changed=build.mcpp");
9+
mcpp::generated("src/generated.cpp");
10+
mcpp::define("BUILT_BY_BUILD_MCPP"); // cfg= → -DBUILT_BY_BUILD_MCPP
11+
mcpp::rerun_if_changed("build.mcpp");
1212
return 0;
1313
}

0 commit comments

Comments
 (0)