-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
set_kind("object") interfers with before_buildcmd_file resulting in undefined references #5426
Comments
try this patch again. #5437 xmake update -s github:xmake-io/xmake#protobuf |
The patch fixes it for protobuf and after porting it my larger project with capnproto also works (using my other capnproto WIP changes I have not opened a PR for yet). Thank you! |
Yes, but each change requires more testing, so I don't consider to modify them all for now because I can't guarantee that they will work well. |
Xmake Version
2.9.4
Operating System Version and Architecture
Debian GNU/Linux trixie/sid, Windows 11 Home
Describe Bug
using a rule with
before_buildcmd_file
inside a target withset_kind("object")
that has another target withset_kind("object")
as dependency, as well as using the rule in the main target results in the generated object file not being linked.I have confirmed that this affects (as used in my example) protobuf and capnproto, but did not test any other code generators
Expected Behavior
The object file should be added to the internal lists of object files in
before_buildcmd_file
, but insteadbefore_buildcmd_file
is executed after the object files have already been collectedProject Configuration
In the attached zip, the xmake.lua has a line
add_deps("empty") -- Comment out this line
. Commenting out this line results in successful compilation, not commenting out this line results in missing symbolsFor demonstration purposes I have used the builtin protobuf module, but the same happens with capnproto. I have not tested it with completely custom rules
Of course this happens also if
empty
has source files, but they aren't necessary for this issue to occurAdditional Information and Error Logs
xmake -vD
does not contain anything related to this issueI have tested it as well on a freshly installed windows 11 instance, but the appended zip should reproduce the error on all platforms
This may have connections to #2476, but seems different as this only appears with dependencies of kind
"object"
.The text was updated successfully, but these errors were encountered: