We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
2.7.3-dev
Archlinux
set_xmakever("2.7.3") set_project("foo") target("a") set_kind("static") add_files("src/a.cpp") target("b") set_kind("static") add_files("src/b.cpp") target("foo") set_kind("binary") add_files("src/main.cpp") add_deps("a", "b")
cmake_minimum_required(VERSION 3.7...3.25) project(Foo LANGUAGES CXX) add_library(a STATIC src/a.cpp) add_library(b STATIC src/b.cpp) add_executable(foo src/main.cpp) target_link_libraries(foo a b)
// main.cpp #include <iostream> extern int b; int main() { std::cout << b << std::endl; return b; } // a.cpp int b = 1; // b.cpp int b = 0;
produce different link behavior
xmake: /usr/sbin/g++ -o build/linux/x64/release/foo build/.objs/foo/linux/x64/release/src/main.cpp.o -m64 -Lbuild/linux/x64/release -lb -la cmake: /usr/sbin/c++ CMakeFiles/foo.dir/src/main.cpp.o -o foo liba.a libb.a
/usr/sbin/g++ -o build/linux/x64/release/foo build/.objs/foo/linux/x64/release/src/main.cpp.o -m64 -Lbuild/linux/x64/release -lb -la
/usr/sbin/c++ CMakeFiles/foo.dir/src/main.cpp.o -o foo liba.a libb.a
Both same link behavior
No response
tested on gcc and msvc
this also affect GCC module support as the link order doesn't match the import order (this doesn't affect msvc through, i don't know for clang)
The text was updated successfully, but these errors were encountered:
try it again on dev
Sorry, something went wrong.
it works fine now !
fix link order #3177 #3144
62ca3cf
The previous fix was wrong, please continue to test the latest dev version.
No branches or pull requests
Xmake Version
2.7.3-dev
Operating System Version and Architecture
Archlinux
Describe Bug
produce different link behavior
xmake:
/usr/sbin/g++ -o build/linux/x64/release/foo build/.objs/foo/linux/x64/release/src/main.cpp.o -m64 -Lbuild/linux/x64/release -lb -la
cmake:
/usr/sbin/c++ CMakeFiles/foo.dir/src/main.cpp.o -o foo liba.a libb.a
Expected Behavior
Both same link behavior
Project Configuration
No response
Additional Information and Error Logs
tested on gcc and msvc
this also affect GCC module support as the link order doesn't match the import order (this doesn't affect msvc through, i don't know for clang)
The text was updated successfully, but these errors were encountered: