diff options
| author | ruki <[email protected]> | 2021-07-15 22:58:21 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-15 22:58:21 +0800 |
| commit | ba4ebd5a676ad15d8d72fe4fefa4d949ea11bc68 (patch) | |
| tree | 817b50173948547f7e4b491da271918c67b8a5ff /tests/projects | |
| parent | 8c1141aba414c07554179cb28687124514f6e770 (diff) | |
| parent | 942c32f448d9b8a850438aa2af1de2415b7ae872 (diff) | |
Merge pull request #1519 from aacirino/master
Added the correct support to build C++ projects that use modules
Diffstat (limited to 'tests/projects')
12 files changed, 20 insertions, 26 deletions
diff --git a/tests/projects/c++/modules/class/src/hello_impl.cpp b/tests/projects/c++/modules/class/src/hello_impl.cpp index b929c453b..6d0008fbb 100644 --- a/tests/projects/c++/modules/class/src/hello_impl.cpp +++ b/tests/projects/c++/modules/class/src/hello_impl.cpp @@ -1,8 +1,7 @@ -// module; -#include <iostream> module hello; -// import std.core; +#include <iostream> + using namespace std; namespace hello { diff --git a/tests/projects/c++/modules/class/xmake.lua b/tests/projects/c++/modules/class/xmake.lua index a3bc3a394..6d6eaddee 100644 --- a/tests/projects/c++/modules/class/xmake.lua +++ b/tests/projects/c++/modules/class/xmake.lua @@ -1,5 +1,4 @@ +set_languages("c++20") target("class") set_kind("binary") add_files("src/*.cpp", "src/*.mpp") - - diff --git a/tests/projects/c++/modules/dependence/src/hello.mpp b/tests/projects/c++/modules/dependence/src/hello.mpp index e29bd7b95..3f803afaf 100644 --- a/tests/projects/c++/modules/dependence/src/hello.mpp +++ b/tests/projects/c++/modules/dependence/src/hello.mpp @@ -17,10 +17,11 @@ export namespace hello { int data_; }; } - +/* #ifndef _MSC_VER export namespace { void anonymous() { } } #endif +*/
\ No newline at end of file diff --git a/tests/projects/c++/modules/dependence/src/hello_impl.cpp b/tests/projects/c++/modules/dependence/src/hello_impl.cpp index 37797c31c..5dbc009f4 100644 --- a/tests/projects/c++/modules/dependence/src/hello_impl.cpp +++ b/tests/projects/c++/modules/dependence/src/hello_impl.cpp @@ -1,6 +1,6 @@ -// module; -#include <iostream> module hello; + +#include <iostream> import mod; void inner() { diff --git a/tests/projects/c++/modules/dependence/xmake.lua b/tests/projects/c++/modules/dependence/xmake.lua index 14d6ca17c..6d64b49b1 100644 --- a/tests/projects/c++/modules/dependence/xmake.lua +++ b/tests/projects/c++/modules/dependence/xmake.lua @@ -1,6 +1,4 @@ +set_languages("c++20") target("dependence") set_kind("binary") add_files("src/*.cpp", "src/*.mpp") - set_languages("c++11") - - diff --git a/tests/projects/c++/modules/hello/src/hello.mpp b/tests/projects/c++/modules/hello/src/hello.mpp index fbd7fd6ad..9bbd036f0 100644 --- a/tests/projects/c++/modules/hello/src/hello.mpp +++ b/tests/projects/c++/modules/hello/src/hello.mpp @@ -1,6 +1,7 @@ -// module; -#include <cstdio> export module hello; + +#include <cstdio> + using namespace std; export namespace hello { diff --git a/tests/projects/c++/modules/hello/xmake.lua b/tests/projects/c++/modules/hello/xmake.lua index 6c3bff19a..2315cf287 100644 --- a/tests/projects/c++/modules/hello/xmake.lua +++ b/tests/projects/c++/modules/hello/xmake.lua @@ -1,5 +1,4 @@ +set_languages("c++20") target("hello") set_kind("binary") add_files("src/*.cpp", "src/*.mpp") - - diff --git a/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp b/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp index 1c9968a51..9cee17cfd 100644 --- a/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp +++ b/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp @@ -1,7 +1,7 @@ -// module; -#include <iostream> module hello; +#include <iostream> + using namespace std; namespace hello { diff --git a/tests/projects/c++/modules/impl_unit/xmake.lua b/tests/projects/c++/modules/impl_unit/xmake.lua index 3d19e0908..abe41d20a 100644 --- a/tests/projects/c++/modules/impl_unit/xmake.lua +++ b/tests/projects/c++/modules/impl_unit/xmake.lua @@ -1,5 +1,4 @@ +set_languages("c++20") target("impl_unit") set_kind("binary") add_files("src/*.cpp", "src/*.mpp") - - diff --git a/tests/projects/c++/modules/inline_and_template/src/hello.mpp b/tests/projects/c++/modules/inline_and_template/src/hello.mpp index 1796f0b11..c36d54783 100644 --- a/tests/projects/c++/modules/inline_and_template/src/hello.mpp +++ b/tests/projects/c++/modules/inline_and_template/src/hello.mpp @@ -1,7 +1,7 @@ -// module; -#include <cstdio> export module hello; +#include <cstdio> + export namespace hello { inline void say_hello() { std::printf("hello world!\n"); diff --git a/tests/projects/c++/modules/inline_and_template/src/say.mpp b/tests/projects/c++/modules/inline_and_template/src/say.mpp index d09e14d28..b4d05a5f4 100644 --- a/tests/projects/c++/modules/inline_and_template/src/say.mpp +++ b/tests/projects/c++/modules/inline_and_template/src/say.mpp @@ -1,7 +1,7 @@ -// module; -#include <cstdio> export module say; +#include <cstdio> + export class say { public: template <int N> diff --git a/tests/projects/c++/modules/inline_and_template/xmake.lua b/tests/projects/c++/modules/inline_and_template/xmake.lua index c0722cccc..4810edb85 100644 --- a/tests/projects/c++/modules/inline_and_template/xmake.lua +++ b/tests/projects/c++/modules/inline_and_template/xmake.lua @@ -1,6 +1,4 @@ +set_languages("c++20") target("inline_and_template") set_kind("binary") add_files("src/*.cpp", "src/*.mpp") - set_languages("c++11") - - |
