diff options
Diffstat (limited to 'tests')
5 files changed, 25 insertions, 20 deletions
diff --git a/tests/projects/c++/modules/stdmodules_deps/src/bar.mpp b/tests/projects/c++/modules/stdmodules_deps/src/bar.mpp index 79d91a393..001cd7c2d 100644 --- a/tests/projects/c++/modules/stdmodules_deps/src/bar.mpp +++ b/tests/projects/c++/modules/stdmodules_deps/src/bar.mpp @@ -4,8 +4,11 @@ import std; export auto my_sum2(std::size_t a, std::size_t b) -> std::size_t; +#if defined(__GNUC__) && !defined(__clang__) +inline +#else module :private; - -auto my_sum2(std::size_t a, std::size_t b) -> std::size_t { +#endif + auto my_sum2(std::size_t a, std::size_t b) -> std::size_t { return a + a + b + b; } diff --git a/tests/projects/c++/modules/stdmodules_deps/src/foo.cpp b/tests/projects/c++/modules/stdmodules_deps/src/foo.cpp new file mode 100644 index 000000000..c1e34dec6 --- /dev/null +++ b/tests/projects/c++/modules/stdmodules_deps/src/foo.cpp @@ -0,0 +1,3 @@ +module foo; + +auto my_sum(std::size_t a, std::size_t b) -> std::size_t { return a + b; } diff --git a/tests/projects/c++/modules/stdmodules_deps/src/foo.mpp b/tests/projects/c++/modules/stdmodules_deps/src/foo.mpp index 17a3795b7..b0aab2fee 100644 --- a/tests/projects/c++/modules/stdmodules_deps/src/foo.mpp +++ b/tests/projects/c++/modules/stdmodules_deps/src/foo.mpp @@ -3,9 +3,3 @@ export module foo; import std; export auto my_sum(std::size_t a, std::size_t b) -> std::size_t; - -module :private; - -auto my_sum(std::size_t a, std::size_t b) -> std::size_t { - return a + b; -} diff --git a/tests/projects/c++/modules/stdmodules_deps/xmake.lua b/tests/projects/c++/modules/stdmodules_deps/xmake.lua index 7ee801b8c..6c53ff594 100644 --- a/tests/projects/c++/modules/stdmodules_deps/xmake.lua +++ b/tests/projects/c++/modules/stdmodules_deps/xmake.lua @@ -3,6 +3,7 @@ set_languages("c++latest") target("foo") set_kind("static") + add_files("src/foo.cpp") add_files("src/foo.mpp", {public = true}) target("bar") diff --git a/tests/projects/c++/modules/test_stdmodules.lua b/tests/projects/c++/modules/test_stdmodules.lua index d9b25ef56..0ca1cc9de 100644 --- a/tests/projects/c++/modules/test_stdmodules.lua +++ b/tests/projects/c++/modules/test_stdmodules.lua @@ -38,21 +38,25 @@ function main(t) end end elseif is_subhost("msys") then - -- os.exec("xmake f -c -p mingw --yes") - -- _build() + local gcc = find_tool("gcc", {version = true}) + if is_host("linux") and gcc and gcc.version and semver.compare(gcc.version, "15.0") >= 0 then + os.exec("xmake f -c -p mingw --yes") + _build() + end elseif is_host("linux") then -- or is_host("macosx") then - -- gcc don't support std modules atm - -- local gcc = find_tool("gcc", {version = true}) - -- if is_host("linux") and gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then - -- os.exec("xmake f -c --yes") - -- _build() - -- end + local gcc = find_tool("gcc", {version = true}) + if is_host("linux") and gcc and gcc.version and semver.compare(gcc.version, "15.0") >= 0 then + os.exec("xmake f -c --yes") + _build() + end local clang = find_tool("clang", {version = true}) if clang and clang.version and semver.compare(clang.version, "19.0") >= 0 then - -- clang don't support libstdc++ std modules atm - -- os.exec("xmake clean -a") - -- os.exec("xmake f --toolchain=clang -c --yes") - -- _build() + local gcc = find_tool("clang", {version = true}) + if gcc and gcc.version and semver.compare(gcc.version, "15.0") >= 0 then + os.exec("xmake clean -a") + os.exec("xmake f --toolchain=clang -c --yes") + _build() + end os.exec("xmake clean -a") os.exec("xmake f --toolchain=clang --runtimes=c++_shared -c --yes") _build() |
