-
系统WSL ArchLinux 问题set_toolchains('clang')
set_runtimes("c++_static") 添加了上面的设置之后,需要额外添加 是否可以通过某种方式自动连接 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
需要改进这里 xmake/xmake/modules/core/tools/clang.lua Line 305 in 3e9e12a 你可以尝试提个 pr 过来。 @Arthapz Any idea about |
Beta Was this translation helpful? Give feedback.
-
and it still works for static lib. ruki@37f873306484:/mnt/xmake/tests/projects/c++/static_library$ xmake -rv
checking for clang ... /usr/bin/clang
checking for the c++ compiler (cxx) ... clang
checking for /usr/bin/clang ... ok
checking for flags (-fPIC) ... ok
checking for flags (-fvisibility-inlines-hidden) ... ok
checking for flags (-O3) ... ok
checking for flags (-DNDEBUG) ... ok
[ 50%]: cache compiling.release src/foo.cpp
/usr/bin/clang -c -Qunused-arguments -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -stdlib=libc++ -DNDEBUG -o build/.objs/foo/linux/x86_64/release/src/foo.cpp.o src/foo.cpp
checking for flags (-MMD -MF) ... ok
checking for flags (-fdiagnostics-color=always) ... ok
checking for the c++ compiler (cxx) ... clang
[ 62%]: cache compiling.release src/main.cpp
/usr/bin/clang -c -Qunused-arguments -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -stdlib=libc++ -DNDEBUG -o build/.objs/demo/linux/x86_64/release/src/main.cpp.o src/main.cpp
checking for ar ... /usr/bin/ar
checking for the static library archiver (ar) ... ar
[ 62%]: archiving.release libfoo.a
/usr/bin/ar -cr build/linux/x86_64/release/libfoo.a build/.objs/foo/linux/x86_64/release/src/foo.cpp.o
checking for clang++ ... /usr/bin/clang++
checking for the linker (ld) ... clang++
checking for /usr/bin/clang++ ... ok
checking for flags (-fPIC) ... ok
checking for flags (clang_static_libstdcxx) ... ok
[ 87%]: linking.release demo
/usr/bin/clang++ -o build/linux/x86_64/release/demo build/.objs/demo/linux/x86_64/release/src/main.cpp.o -m64 -Lbuild/linux/x86_64/release -s -stdlib=libc++ -static-libstdc++ -lfoo
[100%]: build ok, spent 9.066s
ruki@37f873306484:/mnt/xmake/tests/projects/c++/static_library$ nm build/linux/x86_64/release/libfoo.a
foo.cpp.o:
0000000000000000 T add
|
Beta Was this translation helpful? Give feedback.
-
补充:通过添加 |
Beta Was this translation helpful? Give feedback.
try this patch. #5083