diff options
| author | ruki <[email protected]> | 2022-08-03 17:20:55 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-08-03 17:20:55 +0800 |
| commit | d1de4d49e4ae33ea5364bc996a64622fa59af9eb (patch) | |
| tree | ff6903a74a1151035253f53fa8cb805f10eb817f /tests/projects/c++/modules/stl_headerunit | |
| parent | 67a3575689b9761677b48bfb4588712f117924fb (diff) | |
| parent | 728126bd7816bbd5fb6b93cedc7163a425343fba (diff) | |
Merge pull request #2623 from Arthapz/cxx20-modules-support
[Draft] Improve C++20 modules support
Diffstat (limited to 'tests/projects/c++/modules/stl_headerunit')
| -rw-r--r-- | tests/projects/c++/modules/stl_headerunit/src/hello.mpp | 11 | ||||
| -rw-r--r-- | tests/projects/c++/modules/stl_headerunit/src/main.cpp | 6 | ||||
| -rw-r--r-- | tests/projects/c++/modules/stl_headerunit/xmake.lua | 4 |
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/stl_headerunit/src/hello.mpp b/tests/projects/c++/modules/stl_headerunit/src/hello.mpp new file mode 100644 index 000000000..d45c5759e --- /dev/null +++ b/tests/projects/c++/modules/stl_headerunit/src/hello.mpp @@ -0,0 +1,11 @@ +module; + +export module hello; + +import <iostream>; + +export namespace hello { + void say(const char* str) { + std::cout << str << std::endl; + } +} diff --git a/tests/projects/c++/modules/stl_headerunit/src/main.cpp b/tests/projects/c++/modules/stl_headerunit/src/main.cpp new file mode 100644 index 000000000..1e5cc698f --- /dev/null +++ b/tests/projects/c++/modules/stl_headerunit/src/main.cpp @@ -0,0 +1,6 @@ +import hello; + +int main() { + hello::say("hello module!"); + return 0; +} diff --git a/tests/projects/c++/modules/stl_headerunit/xmake.lua b/tests/projects/c++/modules/stl_headerunit/xmake.lua new file mode 100644 index 000000000..e85378c46 --- /dev/null +++ b/tests/projects/c++/modules/stl_headerunit/xmake.lua @@ -0,0 +1,4 @@ +set_languages("c++20") +target("stl_headerunit") + set_kind("binary") + add_files("src/*.cpp", "src/*.mpp") |
