I am trying to link two static libraries using cmake but I don't get the result I expect when I look into the libraries using ar -t
.
A small example where library A is linked to B:
File a.c
:
void a(){}
File b.c
:
void b(){}
File CMakeLists.txt
:
project(test C)
add_library(a STATIC "a.c")
add_library(b STATIC "b.c")
target_link_libraries(a b)
I expected to see both object files in the output ar -t liba.a
but instead I only see a.c.o
in the output.