diff options
| author | ruki <[email protected]> | 2019-09-06 22:51:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-09-06 11:11:25 +0800 |
| commit | 7210427c931d41fd52608ee5a502ea54414d6606 (patch) | |
| tree | ade539fdb971d8974efcc14e20819fe187601c63 /tests/projects/c++/modules/modulemap.modulemap | |
| parent | 5c0286dd6ec8c3f8bf7e6c4e7cecd9d5903948e8 (diff) | |
add some c++ module tests
Diffstat (limited to 'tests/projects/c++/modules/modulemap.modulemap')
4 files changed, 37 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/modulemap.modulemap/src/hello.h b/tests/projects/c++/modules/modulemap.modulemap/src/hello.h new file mode 100644 index 000000000..743934c26 --- /dev/null +++ b/tests/projects/c++/modules/modulemap.modulemap/src/hello.h @@ -0,0 +1,18 @@ +#pragma once + +import std; +using namespace std; + +namespace hello { + inline void say_hi() { + cout << "hello hi!" << endl; + } + + inline void say_hello() { + cout << "hello world!" << endl; + } + + inline void say_xz() { + cout << "hello xz!" << endl; + } +}
\ No newline at end of file diff --git a/tests/projects/c++/modules/modulemap.modulemap/src/main.cpp b/tests/projects/c++/modules/modulemap.modulemap/src/main.cpp new file mode 100644 index 000000000..6fffc01f7 --- /dev/null +++ b/tests/projects/c++/modules/modulemap.modulemap/src/main.cpp @@ -0,0 +1,9 @@ +// #include "hello.h" +import hello; + +int main() { + hello::say_hello(); + hello::say_xz(); + hello::say_hi(); + return 0; +}
\ No newline at end of file diff --git a/tests/projects/c++/modules/modulemap.modulemap/src/module.modulemap b/tests/projects/c++/modules/modulemap.modulemap/src/module.modulemap new file mode 100644 index 000000000..69c787ee2 --- /dev/null +++ b/tests/projects/c++/modules/modulemap.modulemap/src/module.modulemap @@ -0,0 +1,4 @@ +module hello { + header "hello.h" + export * +} diff --git a/tests/projects/c++/modules/modulemap.modulemap/xmake.lua b/tests/projects/c++/modules/modulemap.modulemap/xmake.lua new file mode 100644 index 000000000..979f7a22e --- /dev/null +++ b/tests/projects/c++/modules/modulemap.modulemap/xmake.lua @@ -0,0 +1,6 @@ +target("modulemap") + set_kind("binary") + add_files("src/*.cpp", "src/*.mpp") + set_languages("c++20") + + |
