{"id":44638599,"url":"https://github.com/vpetrigo/arm-cmake-toolchains","last_synced_at":"2026-02-14T18:07:02.434Z","repository":{"id":39042486,"uuid":"84006633","full_name":"vpetrigo/arm-cmake-toolchains","owner":"vpetrigo","description":"CMake toolchain configurations for ARM","archived":false,"fork":false,"pushed_at":"2025-12-30T23:55:54.000Z","size":380,"stargazers_count":285,"open_issues_count":2,"forks_count":52,"subscribers_count":18,"default_branch":"master","last_synced_at":"2026-01-03T23:34:01.160Z","etag":null,"topics":["arm","arm-gcc","clang","cmake","cmake-files","cortex-m","efm32","gcc","nrf52","stm32","toolchain-cmake"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vpetrigo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"vpetrigo","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://boosty.to/vladimir.petrigo"]}},"created_at":"2017-03-05T22:21:49.000Z","updated_at":"2025-12-30T23:55:58.000Z","dependencies_parsed_at":"2024-01-13T04:59:12.800Z","dependency_job_id":"d30fa287-a448-44d3-b4cd-56080919c281","html_url":"https://github.com/vpetrigo/arm-cmake-toolchains","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vpetrigo/arm-cmake-toolchains","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpetrigo%2Farm-cmake-toolchains","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpetrigo%2Farm-cmake-toolchains/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpetrigo%2Farm-cmake-toolchains/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpetrigo%2Farm-cmake-toolchains/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpetrigo","download_url":"https://codeload.github.com/vpetrigo/arm-cmake-toolchains/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpetrigo%2Farm-cmake-toolchains/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","arm-gcc","clang","cmake","cmake-files","cortex-m","efm32","gcc","nrf52","stm32","toolchain-cmake"],"created_at":"2026-02-14T18:07:02.378Z","updated_at":"2026-02-14T18:07:02.427Z","avatar_url":"https://github.com/vpetrigo.png","language":"CMake","funding_links":["https://github.com/sponsors/vpetrigo","https://boosty.to/vladimir.petrigo"],"categories":[],"sub_categories":[],"readme":"[![Example projects build](https://github.com/vpetrigo/arm-cmake-toolchains/actions/workflows/build.yml/badge.svg)](https://github.com/vpetrigo/arm-cmake-toolchains/actions/workflows/build.yml)\n![GitHub](https://img.shields.io/github/license/vpetrigo/arm-cmake-toolchains)\n\n# CMake toolchain files for ARM GCC compiler\n\nThis repo contains CMake toolchain files that utilizes [ARM GCC](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm).\nMCU families that can be used:\n- STM32 (F0, F1, F2, F3, F4, F7, G0, G4, H7, L0, L1, L4, L5, U5, WB, WL)\n- nRF51/nRF52 (nRF52832, nRF52840, nRF51822)\n- NXP Kinetis (LPC800, LPC5500, K-series like K64)\n- Many more (any Cortex-M based) :smile:\n\nOne of them `arm-gcc-toolchain.cmake` uses `arm-none-eabi-gcc` suite to build CMake project. To use it the toolchain must \nbe added to the system PATH variable.\n\n*Example for Ninja generator, Debug build*:\n\n```sh\nPATH=\u003cpath/to/arm-none-eabi\u003e:$PATH cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=arm-gcc-toolchain.cmake -DCMAKE_BUILD_TYPE=Debug\n```\n\n`clang-arm-gcc-toolchain.cmake` uses Clang front-end as a compiler that has some additional code analyzer \nfeatures with comprehensive warning/errormessages.\n\n## Example projects\n\n- EFM32GG on STK3700 board:\n  - [simple LED blinking](examples/efm32/led)\n- K64F on FRDM-K64F board:\n  - [simple LED blinking](examples/nxp/led)\n\n## Customization of toolchain file\n\nNow the `arm-gcc-toolchain.cmake` and `clang-arm-gcc-toolchain.cmake` files use `arm-none-eabi` compiler triple and prefix. In case\nyou want to use another compiler you should change the `TOOLCHAIN_PREFIX` variable in both CMake toolchain files and `TOOLCHAIN_TRIPLE` for\nClang-specific file only:\n\n```cmake\n# arm-gcc-toolchain.cmake and clang-arm-gcc-toolchain.cmake\nset(TOOLCHAIN_PREFIX \u003cyour-compiler-prefix\u003e)\n# clang-arm-gcc-toolchain.cmake ONLY\nset(TOOLCHAIN_TRIPLE \u003cyour-compiler-triple\u003e)\n```\n\nAlso some options which is essential for **Cortex-M** specific compiler (`arm-none-eabi`) might be not relevant for your compiler.\nIn that case you should simply delete obsolete lines from toolchain CMake file. For example the line below is not relevant for\nuClinux compiler:\n\n```cmake\nset(CMAKE_EXE_LINKER_FLAGS_INIT \"--specs=nosys.specs\")\n```\n\nAnd that line can be deleted while you use `arm-uclinuxeabi` compiler without any side effect.\n\n## Additional macros/functions in utils.cmake\n\nIn the `utils.cmake` file you can find some useful macros/functions that you can add into your CMake files. \nTo do that you need to include `utils.cmake`:\n\n```cmake\n# CMakeLists.txt somewhere in your project\ninclude(\u003cpath-to-utils-file\u003e/utils.cmake)\n```\n\nIt might be a good idea to include that file in your project's root `CMakeLists.txt` to allow other CMake files, \nwhich may reside in subdirectories, to use provided features.\n\n- `subdirlist`:\n\n```cmake\n# store all subfolder names in a ${result} variable\n# might be useful when you have lots of subdirectories with\n# headers and do not want to type them manually\n# IMPORTANT: ${result} contains paths relative to a ${current_dir}\nsubdirlist(result current_dir)\n\ntarget_include_directories(\u003ctarget\u003e ${result})\n```\n\n- `prepend_cur_dir`:\n\n```cmake\n# prepend ${CMAKE_CURRENT_SOURCE_DIR} to a directory\n# so that you have the full path to a header/source file\n# and store the result in the provided ${variable}\nprepend_cur_dir(full_path_to_dir dir)\n# the ${full_path_to_dir} for dir/ might be like:\n${full_path_to_dir} -\u003e C:/Users/SpecificUser/Project/dir\n```\n\n- `firmware_size`:\n\n```cmake\n# function that adds custom target that will\n# output resulted executable image size by using \n# binutils size command\nadd_executable(hello_world main.c)\n...\nfirmware_size(hello_world)\n# Possible output:\n# text    data    bss     dec     hex     filename\n# 294880  81920   11592   388392  5ed28   hello_world\n```\n\n- `generate_object`:\n\n```cmake\n# function that adds custom target that will\n# generate additional output file with specified\n# type by using binutils objcopy\nadd_executable(hello_world main.c)\n...\ngenerate_object(hello_world .hex ihex)\n# in addition to .elf file the hex file for\n# hello_world firmware would be generated\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpetrigo%2Farm-cmake-toolchains","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpetrigo%2Farm-cmake-toolchains","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpetrigo%2Farm-cmake-toolchains/lists"}