build-cpp / cmkr

Modern build system based on CMake and TOML.
https://cmkr.build
MIT License
438 stars 27 forks source link

Examples of cross-compiling / embedded usage #141

Open bitandquit opened 4 months ago

bitandquit commented 4 months ago

Hi,

This is a great project!

I wanted to ask, can you provide some examples that show how to cross-compile for embedded use-cases? For example, would it just be setting the 'CC' environment variable? How would I specify something like a linker script, and the C-start-up code?

This is all commonly done for embedded environments (baremetals, without an OS, etc).

This is an example (not mine) of CMake for an ARM cortex-m0: https://github.com/infohoschie/arm-cortex-m0-cmake

mrexodia commented 4 months ago

You would call cmake with -DCMAKE_TOOLCHAIN_FILE=... as usual.