summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2022-02-17 22:47:48 +0800
committerruki <[email protected]>2022-02-17 22:47:48 +0800
commit168e70b7e06cfcfbadff763fed0d838b92130ad9 (patch)
tree401fe00d3aaa38d7db950f1d90eba8a292b9d24e /tests
parent54efc65b6ed2dfc86c28ba7cc3f40a6084785026 (diff)
improve modules with space
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/c++/modules/hello with spaces/src/hello.mpp10
-rw-r--r--tests/projects/c++/modules/hello with spaces/src/main.cpp6
-rw-r--r--tests/projects/c++/modules/hello with spaces/xmake.lua4
-rw-r--r--tests/projects/c++/modules/hello/xmake.lua2
4 files changed, 21 insertions, 1 deletions
diff --git a/tests/projects/c++/modules/hello with spaces/src/hello.mpp b/tests/projects/c++/modules/hello with spaces/src/hello.mpp
new file mode 100644
index 000000000..124bd72bc
--- /dev/null
+++ b/tests/projects/c++/modules/hello with spaces/src/hello.mpp
@@ -0,0 +1,10 @@
+module;
+#include <cstdio>
+
+export module hello;
+
+export namespace hello {
+ void say(const char* str) {
+ printf("%s\n", str);
+ }
+}
diff --git a/tests/projects/c++/modules/hello with spaces/src/main.cpp b/tests/projects/c++/modules/hello with spaces/src/main.cpp
new file mode 100644
index 000000000..1e5cc698f
--- /dev/null
+++ b/tests/projects/c++/modules/hello with spaces/src/main.cpp
@@ -0,0 +1,6 @@
+import hello;
+
+int main() {
+ hello::say("hello module!");
+ return 0;
+}
diff --git a/tests/projects/c++/modules/hello with spaces/xmake.lua b/tests/projects/c++/modules/hello with spaces/xmake.lua
new file mode 100644
index 000000000..6a69ce121
--- /dev/null
+++ b/tests/projects/c++/modules/hello with spaces/xmake.lua
@@ -0,0 +1,4 @@
+set_languages("c++20")
+target("A hello")
+ set_kind("binary")
+ add_files("src/*.cpp", "src/*.mpp")
diff --git a/tests/projects/c++/modules/hello/xmake.lua b/tests/projects/c++/modules/hello/xmake.lua
index 6a69ce121..2315cf287 100644
--- a/tests/projects/c++/modules/hello/xmake.lua
+++ b/tests/projects/c++/modules/hello/xmake.lua
@@ -1,4 +1,4 @@
set_languages("c++20")
-target("A hello")
+target("hello")
set_kind("binary")
add_files("src/*.cpp", "src/*.mpp")