[CMake] does cmake get dependencies between asm files? and when said so does it link them?

Ivan Sergio Borgonovo mail at webthatworks.it
Fri Nov 1 07:07:19 EDT 2013


On Fri, 1 Nov 2013 11:37:10 +0100
Alexander Neundorf <a.neundorf-work at gmx.net> wrote:

> so crt0.x is the missing one, right ?
> Are you sure it is not compiled ?

Absolutely. Once I've added
add_dependencies(someotherasm crt0.x)
crt0.x got compiled BUT not linked.

But even after I succede to compile libcrt0.a and even if crt0 was
included in the target_link_libraries() list it was missing from the
list of the actually linked libraries.
That mean I had a libcrt0.a but cmake was running gcc without it in the
list of libraries to link.

I finally found a way to force cmake to link it adding 
set_property(TARGET SAM3 APPEND PROPERTY LINK_LIBRARIES crt0)
after target_link_libraries().

I don't know if this is the best way to do it but it works.

Anyway I ran into a new list of problems I'm still investigating.

So as for the

"how to make cmake recognize different asm extension"

and the

"how to force cmake to compile and link asm files when it seems it
can't get dependencies right"

the problem seems solved

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the CMake mailing list