-
Notifications
You must be signed in to change notification settings - Fork 5.7k
FIX: propagation dependencies and rebuild out of date libs #2751
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
Conversation
set(outlibfile "$<TARGET_FILE:${TARGET_NAME}>") | ||
|
||
foreach(lib ${libs}) | ||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD | ||
COMMAND ${CMAKE_AR} ru ${outlibfile} @"../${lib}.objlist" | ||
WORKING_DIRECTORY ${lib}.objdir) | ||
COMMAND ${CMAKE_AR} cr ${outlibfile} *.o |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using modifier: u
?
r[ab][f][u] - replace existing or insert new file(s) into the archive
[u] - only replace files that are newer than current archive contents
[c] - do not warn if the library had to be created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this flag, it can add new symbols into the library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Pain points:
When I implemented buddy allocator, finally I want to merge all small pieces libraries to
paddle_memory
for testing memory recycling effects.I found the original generic implementation doesn't allow propagation dependencies and also cannot track out of date records.
The new features for merging static libraries.