diff options
| author | ruki <[email protected]> | 2022-12-07 22:56:12 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-07 22:56:12 +0800 |
| commit | fff1a89bb33b4c5dd99307eca8d12b65452d5806 (patch) | |
| tree | 5d07c9ad5157e36fde51afd4e1211def01de445d /tests/projects/c++ | |
| parent | 148c595c7b552d08573d8d1c12b7c97951c8498a (diff) | |
| parent | 911e781d4b2a4aa4260fba1b2c012855c7ee1d9b (diff) | |
Merge pull request #3141 from Arthapz/fix-gcc-link-module-order
Fix import order on GCC and force it on clang and msvc
Diffstat (limited to 'tests/projects/c++')
5 files changed, 38 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/link_order/src/bar.mpp b/tests/projects/c++/modules/link_order/src/bar.mpp new file mode 100644 index 000000000..dc7c14ec8 --- /dev/null +++ b/tests/projects/c++/modules/link_order/src/bar.mpp @@ -0,0 +1,5 @@ +export module duplicate; + +export int value() { + return 1; +} diff --git a/tests/projects/c++/modules/link_order/src/foo.mpp b/tests/projects/c++/modules/link_order/src/foo.mpp new file mode 100644 index 000000000..eba3a4223 --- /dev/null +++ b/tests/projects/c++/modules/link_order/src/foo.mpp @@ -0,0 +1,5 @@ +export module duplicate; + +export int value() { + return 0; +} diff --git a/tests/projects/c++/modules/link_order/src/main.cpp b/tests/projects/c++/modules/link_order/src/main.cpp new file mode 100644 index 000000000..cd9524d8b --- /dev/null +++ b/tests/projects/c++/modules/link_order/src/main.cpp @@ -0,0 +1,5 @@ +import duplicate; + +int main() { + return value(); +} diff --git a/tests/projects/c++/modules/link_order/test.lua b/tests/projects/c++/modules/link_order/test.lua new file mode 100644 index 000000000..7717f8049 --- /dev/null +++ b/tests/projects/c++/modules/link_order/test.lua @@ -0,0 +1 @@ +inherit(".test_base") diff --git a/tests/projects/c++/modules/link_order/xmake.lua b/tests/projects/c++/modules/link_order/xmake.lua new file mode 100644 index 000000000..6a11418ac --- /dev/null +++ b/tests/projects/c++/modules/link_order/xmake.lua @@ -0,0 +1,22 @@ +add_rules("mode.release", "mode.debug") +set_languages("c++20") + +target("foo") + add_rules("c++") + set_kind("static") + add_files("src/foo.mpp") + +target("bar") + add_rules("c++") + set_kind("static") + add_files("src/bar.mpp") + +target("link_order_1") + set_kind("binary") + add_deps("foo", "bar") + add_files("src/main.cpp") + +target("link_order_2") + set_kind("binary") + add_deps("bar", "foo") + add_files("src/main.cpp") |
