[CMake] linking static library.

Łukasz Tasz lukasz at tasz.eu
Wed Dec 5 11:38:38 EST 2012


Hi all,

I have a problem with making static library.
There is behaviour which is not clear for me.

I have long list of objects to be linked. For shared library linking
is done as one g++ command,
For static sources are grouped into few groups and there is sequence of:
ar cr libnanme obj_list1
ar r libnanme obj_list2
ar r libnanme obj_list3
...

Could somebody explain me what's the reason for such a grouping?
Issue at my side is that both objects wont go to the archive if:
ar cr .... foo/foo.o ....
ar r ....  bar/foo.o ....

bar/foo.o will replace foo/foo.o

I know it's not a good idea to put same name of object info archive,
but it's still valid...

I would like to avoid replacing template for appending to static
library CMAKE_C_ARCHIVE_APPEND

thank in advance
Łukasz Tasz


More information about the CMake mailing list