diff options
| author | Christian Rendina <[email protected]> | 2025-04-10 09:50:37 +0200 |
|---|---|---|
| committer | Christian Rendina <[email protected]> | 2025-04-10 09:50:37 +0200 |
| commit | 78723913d76fb8b615df34541236b8ea588d30db (patch) | |
| tree | b6b6ff550e4a2f73d94c63a61876cec31a4b3ae3 /tests/projects/c++/modules/test_pch.lua | |
| parent | 2051c13f735a626f7b6fd8b98aa69f01fd9cef7e (diff) | |
| parent | fd49b7754c6709a87b5beb5526788bbc1a663965 (diff) | |
Merge branch 'dev' of https://github.com/xmake-io/xmake into dev
Diffstat (limited to 'tests/projects/c++/modules/test_pch.lua')
| -rw-r--r-- | tests/projects/c++/modules/test_pch.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/test_pch.lua b/tests/projects/c++/modules/test_pch.lua new file mode 100644 index 000000000..98286c229 --- /dev/null +++ b/tests/projects/c++/modules/test_pch.lua @@ -0,0 +1,31 @@ +import("lib.detect.find_tool") +import("core.base.semver") +import("detect.sdks.find_vstudio") +import("utils.ci.is_running", {alias = "ci_is_running"}) + +function _build() + if ci_is_running() then + os.run("xmake -rvD") + else + os.run("xmake -r") + end + local outdata = os.iorun("xmake") + if outdata then + if outdata:find("compiling") or outdata:find("linking") or outdata:find("generating") then + raise("Modules incremental compilation does not work\n%s", outdata) + end + end +end + +function main(t) + -- TODO c++ modules with pch does not work for gcc now. + if is_host("linux") then + local clang = find_tool("clang", {version = true}) + if clang then + os.exec("xmake f --toolchain=clang -c --yes --policies=build.c++.modules.std:n,build.c++.clang.fallbackscanner") + _build() + end + else + _build() + end +end |
