[CMake] cross-compilation: add dependency to all linked targets

Patrick Boettcher patrick.boettcher at posteo.de
Tue Mar 8 07:03:18 EST 2016


Hi list,

I'm building applications for an bare-metal sytem. There
are no standard libraries.

In my toolchain-file I specify 

  set(CMAKE_SYSTEM_NAME "Generic")

and I'm telling gcc to not include std-libraries with -nostdlib .

In my toolchain-file I changed 

  CMAKE_EXE_LINKER_FLAGS

in order to link with my LdScript and to add basic stuff during link.
A crt0 for my platform myself and other stuff in the future.

Is there a way to add a dependency to (existing) files in a generic
manner so that all executable- and library-targets are getting a
link-dependency?

Like a system-library-template-variable to fill in.

Thanks in advance for any help.

best regards,
--
Patrick.









More information about the CMake mailing list