`cc_binary` DEPS should handle dependencies order
Created by: reyoung
Currently, generic.cmake
provides cc_binary
to compile c++ binary. It uses DEPS
arguments to get like libraries. But setting DEPS
should in a link correct order, i.e., if several libraries need to be linked, the library A depends on library B, the link order must be A B
not B A
. Reference link
It seems we should provide an API easy to use, so maybe we should make libraries surrounded by
-Wl,--start-group
...
-Wl,--end-group
I am not quite sure are there any disadvantages for start-group/end-group
. So please do not hesitate to comment if you have any concerns about this issue.
If start-group/end-group
is OK for us, I will give an PR within today.