diff --git a/.pi/skills/cmake/SKILL.md b/.pi/skills/cmake/SKILL.md index 1034f28..19e7e91 100644 --- a/.pi/skills/cmake/SKILL.md +++ b/.pi/skills/cmake/SKILL.md @@ -1,12 +1,15 @@ --- name: cmake -description: CMake build configuration for the ctdd template project. Use when - adding modules, adding dependencies, configuring coverage or sanitizers, or - understanding the build system. +description: CMake build configuration for projects scaffolded from the ctdd + template. Use when adding modules, adding dependencies, configuring coverage + or sanitizers, or understanding the build system. --- # CMake Skill +> Replace `/` with the project source directory (e.g. `ctdd/`, `src/`). +> Replace `` with the module name (e.g. `counter`, `timer`). + ## Build Commands | Action | Command | @@ -21,19 +24,19 @@ description: CMake build configuration for the ctdd template project. Use when ## Adding a Module -Modules live in `ctdd/` as static libraries. Register them in -`ctdd/CMakeLists.txt`: +Modules live in `/` as static libraries. Register them in +`/CMakeLists.txt`: ```cmake -add_library(ctdd_ .c) -target_include_directories(ctdd_ PUBLIC "${CMAKE_SOURCE_DIR}") -target_compile_features(ctdd_ PRIVATE c_std_23) +add_library(_ .c) +target_include_directories(_ PUBLIC "${CMAKE_SOURCE_DIR}") +target_compile_features(_ PRIVATE c_std_23) ``` Link into `main` in the root `CMakeLists.txt`: ```cmake -target_link_libraries(main PRIVATE ... ctdd_) +target_link_libraries(main PRIVATE ... _) ``` ## Adding a Dependency @@ -82,10 +85,10 @@ Place it after `include(Platform)` and `include(Flags)`. ### 3. Link with `::` -In `ctdd/CMakeLists.txt` or `tests/CMakeLists.txt` as needed: +In `/CMakeLists.txt` or `tests/CMakeLists.txt` as needed: ```cmake -target_link_libraries(ctdd_ PRIVATE ::) +target_link_libraries(_ PRIVATE ::) ``` ## Platform Flags @@ -136,7 +139,7 @@ Generated mocks go into `build/mocks/` as `Mock.h/.c`. ## Coverage Enabled via `-DENABLE_COVERAGE=ON`. Requires GCC or Clang + `gcovr`. -Report at `build-cov/coverage/index.html`. Only `ctdd/` sources are +Report at `build-cov/coverage/index.html`. Only `/` sources are measured; Unity, CMock, and mocks are excluded. ## Sanitizers