-
-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Modules] xmake uses inconsistent STL for different targets #3373
Comments
I have improved it, try it again. 9e8183b And I need remove diff --git a/third_party_module/stdmodules/tuple.cppm b/third_party_module/stdmodules/tuple.cppm
index e4bd882..9226d0b 100644
--- a/third_party_module/stdmodules/tuple.cppm
+++ b/third_party_module/stdmodules/tuple.cppm
@@ -7,5 +7,5 @@ export namespace std {
using std::get;
using std::tie;
using std::make_tuple;
- using std::ignore;
+// using std::ignore;
} And I got errors.
|
Thanks. The implementation of async_simple is based on libstdc++10 and it is not surprise to me that it can't compile in other versions. Now I see it would use libc++ by default. How can I force it to use libstdc++? |
Currently there is no configuration to explicitly switch to libstdc++, I will improve the configuration to support it, but it may take a while. |
Thanks. |
you can try after updating.
|
Thanks. It solves my problem. |
and I added libaio package in xmake-repo, we can use it directly. add_rules("mode.debug", "mode.release")
set_languages("c++20")
add_cxxflags("-stdlib=libstdc++")
add_requires("libaio")
target("std")
set_kind("static")
add_files("third_party_module/stdmodules/*.cppm")
add_includedirs("third_party_module/stdmodules")
target("asio")
set_kind("static")
add_files("third_party_module/asio/asio.cppm")
add_includedirs("third_party_module/asio")
target("async_simple")
set_kind("static")
add_files("async_simple_module/*.cppm",
"async_simple_module/coro/*.cppm",
"async_simple_module/executors/*.cppm",
"async_simple_module/uthread/*.cppm",
"async_simple_module/uthread/internal/*.cppm",
"async_simple_module/util/*.cppm")
add_deps("std")
add_packages("libaio") |
(you can switch your -stdlib on commandline too |
Xmake Version
xmake v2.7.6+master.7f8eefb8a
Operating System Version and Architecture
linux
Describe Bug
I am trying to compile https://github.com/alibaba/async_simple/tree/CXX20Modules with xmake.
Bug I meet a surprising error message:
Look carefully into the error message, I found the first one uses libstdc++ while the second one uses libc++. So here is the problem. Then I find that xmake wouldn't append
-stdlib=libc++
for module units of std but xmake would append-stdlib=libc++
for module units under async_simple.Here is the command for std:utility:
Here is the command for async_simple:Unit
Expected Behavior
The targets in the same project should use the same configuration for STL.
Project Configuration
No response
Additional Information and Error Logs
No response
The text was updated successfully, but these errors were encountered: