All Projects → vpetrigo → Arm Cmake Toolchains

vpetrigo / Arm Cmake Toolchains

Licence: bsd-3-clause
CMake toolchain configurations for ARM

Projects that are alternatives of or similar to Arm Cmake Toolchains

Xpcc
DEPRECATED, use our successor library https://modm.io instead
Stars: ✭ 177 (+19.59%)
Mutual labels:  gcc, arm, stm32, cortex-m
Polymcu
An open framework for micro-controller software
Stars: ✭ 173 (+16.89%)
Mutual labels:  cmake, clang, gcc, arm
Avalonstudio
Cross platform IDE and Shell
Stars: ✭ 1,132 (+664.86%)
Mutual labels:  clang, gcc, stm32
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (+36.49%)
Mutual labels:  cmake, clang, gcc
TMcuSys
🍆 STM32平台uCos与emWin练习项目。图片、音乐、视频、游戏、IAP运行器。
Stars: ✭ 25 (-83.11%)
Mutual labels:  arm, cortex-m, stm32
stm32f103xx
DEPRECATED
Stars: ✭ 31 (-79.05%)
Mutual labels:  arm, cortex-m, stm32
Fixed point
C++ Binary Fixed-Point Arithmetic
Stars: ✭ 199 (+34.46%)
Mutual labels:  cmake, clang, gcc
JBC SolderingStation
JBC_SolderingStation
Stars: ✭ 63 (-57.43%)
Mutual labels:  arm, gcc, stm32
async-stm32f1xx
Abstractions for asynchronous programming on the STM32F1xx family of microcontrollers.
Stars: ✭ 24 (-83.78%)
Mutual labels:  arm, cortex-m, stm32
bleeding-edge-toolchain
All-in-one script to build bleeding-edge-toolchain for ARM microcontrollers
Stars: ✭ 60 (-59.46%)
Mutual labels:  arm, cortex-m, gcc
Cmakepchcompiler
CMake precompiled header support via custom PCH compiler extension
Stars: ✭ 105 (-29.05%)
Mutual labels:  cmake, clang, gcc
Moderncppci
This is an example of doing a Modern C++ project with CI
Stars: ✭ 109 (-26.35%)
Mutual labels:  cmake, clang, gcc
rebuild
Zero-dependency, reproducible build environments
Stars: ✭ 48 (-67.57%)
Mutual labels:  arm, gcc, clang
Boomerang
Boomerang Decompiler - Fighting the code-rot :)
Stars: ✭ 265 (+79.05%)
Mutual labels:  cmake, clang, gcc
Embedded Ide
IDE for C embedded development centered on bare-metal ARM systems
Stars: ✭ 127 (-14.19%)
Mutual labels:  clang, gcc, cortex-m
Antara Gaming Sdk
Komodo Gaming Software Development Kit
Stars: ✭ 51 (-65.54%)
Mutual labels:  cmake, clang
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+6027.03%)
Mutual labels:  arm, stm32
C2goasm
C to Go Assembly
Stars: ✭ 1,072 (+624.32%)
Mutual labels:  clang, gcc
Stm32liquidcrystal
Liquid Crystal Library for STM32
Stars: ✭ 24 (-83.78%)
Mutual labels:  arm, stm32
Cxxctp
DEPRECATED. USE INSTEAD github.com/blockspacer/flextool
Stars: ✭ 58 (-60.81%)
Mutual labels:  cmake, clang

Build Status GitHub

CMake toolchain files for ARM GCC compiler

This repo contains CMake toolchain files that utilizes ARM GCC.

One of them arm-gcc-toolchain.cmake uses arm-none-eabi-gcc suite to build CMake project. To use it the toolchain must be added to the system PATH variable.

Example for Ninja generator, Debug build:

PATH=<path/to/arm-none-eabi>:$PATH cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=arm-gcc-toolchain.cmake -DCMAKE_BUILD_TYPE=Debug

clang-arm-gcc-toolchain.cmake uses Clang front-end as a compiler that has some additional code analyzer features with comprehensive warning/errormessages.

Example projects

Customization of toolchain file

Now the arm-gcc-toolchain.cmake and clang-arm-gcc-toolchain.cmake files use arm-none-eabi compiler triple and prefix. In case you want to use another compiler you should change the TOOLCHAIN_PREFIX variable in both CMake toolchain files and TOOLCHAIN_TRIPLE for Clang-specific file only:

# arm-gcc-toolchain.cmake and clang-arm-gcc-toolchain.cmake
set(TOOLCHAIN_PREFIX <your-compiler-prefix>)
# clang-arm-gcc-toolchain.cmake ONLY
set(TOOLCHAIN_TRIPLE <your-compiler-triple>)

Also some options which is essential for Cortex-M specific compiler (arm-none-eabi) might be not relevant for your compiler. In that case you should simply delete obsolete lines from toolchain CMake file. For example the line below is not relevant for uClinux compiler:

set(CMAKE_EXE_LINKER_FLAGS_INIT "--specs=nosys.specs")

And that line can be deleted while you use arm-uclinuxeabi compiler without any side effect.

Additional macros/functions in utils.cmake

In the utils.cmake file you can find some useful macros/functions that you can add into your CMake files. To do that you need to include utils.cmake:

# CMakeLists.txt somewhere in your project
include(<path-to-utils-file>/utils.cmake)

It might be a good idea to include that file in your project's root CMakeLists.txt to allow other CMake files, which may reside in subdirectories, to use provided features.

  • subdirlist:
# store all subfolder names in a ${result} variable
# might be useful when you have lots of subdirectories with
# headers and do not want to type them manually
# IMPORTANT: ${result} contains paths relative to a ${current_dir}
subdirlist(result current_dir)

target_include_directories(<target> ${result})
  • prepend_cur_dir:
# prepend ${CMAKE_CURRENT_SOURCE_DIR} to a directory
# so that you have the full path to a header/source file
# and store the result in the provided ${variable}
prepend_cur_dir(full_path_to_dir dir)
# the ${full_path_to_dir} for dir/ might be like:
${full_path_to_dir} -> C:/Users/SpecificUser/Project/dir
  • firmware_size:
# function that adds custom target that will
# output resulted executable image size by using 
# binutils size command
add_executable(hello_world main.c)
...
firmware_size(hello_world)
# Possible output:
# text    data    bss     dec     hex     filename
# 294880  81920   11592   388392  5ed28   hello_world
  • generate_object:
# function that adds custom target that will
# generate additional output file with specified
# type by using binutils objcopy
add_executable(hello_world main.c)
...
generate_object(hello_world .hex ihex)
# in addition to .elf file the hex file for
# hello_world firmware would be generated
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].