[Feature Request] Flexible CMake configuration
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- c, cmake
- 領域
- build-system
調査の方向性
The build logic lives in the top-level CMakeLists.txt and in portable/CMakeLists.txt, where the addPort definitions are. Start by reading how FREERTOS_PORT and the freertos_config target are consumed, since the proposal turns both into per-port INTERFACE targets. The issue is a design proposal with no maintainer reply, so agree on the target layout with maintainers before editing. Done means the backwards-compatible FREERTOS_PORT path still builds and a multi-port configuration links.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
We have multiple CMake targets in one project, which build the same controller with different configurations.
Currently, FreeRTOS builds as a single static library with fixed configuration for each CMake invocation. This would require separate CMake build directories for different configurations.
This refers both to:
- port selection via
FREERTOS_PORT - configuration variables via linking to
freertos_configand includingFreeRTOSConfig.h
Describe the solution you'd like
Switch from STATIC and OBJECT libraries to INTERFACE libraries.
Different application configurations explicitly link against different ports or different config-INTERFACE-libraries. FreeRTOS itself does not explicitly link to port or config libraries.
Advantages:
- Different application targets can use different
freertos_configlibraries - Different application targets can use different ports (e.g. one NS and one NTZ configuration)
Disadvantages:
- As far as I understand, some headers are hidden from the application by not exposing their directories as
target_include_dirs. This would not work when using theINTERFACEtargets. However, this would remain effective when using the backwards-compatible mode.
Describe alternatives you've considered
- Keeping local/internal patches
- Writing own CMake code instead of using the provided one
How many devices will this feature impact?
I cannot disclose this information.
What are your project timelines?
I will implement a local/internal solution in the next few days. This issue is mostly an offer to integrate the local work upstream. Timeline for the PR would be ~1-4weeks.
Additional context
I am willing to provide a PR for this feature if the issue is accepted as a valid improvement.
Example usage:
// old:
if(CONFIG_SELECTION STREQUAL "NTZ")
set(FREERTOS_PORT GCC_ARM_CM33_NTZ_NONSECURE)
target_include_directories(freertos_config INTERFACE ${CMAKE_CURRENT_LIST_DIR}/config/ntz)
elseif(CONFIG_SELECTION STREQUAL "NS")
set(FREERTOS_PORT GCC_ARM_CM33_NONSECURE)
target_include_directories(freertos_config INTERFACE ${CMAKE_CURRENT_LIST_DIR}/config/ns)
endif()
target_link_libraries(myApp
freertos_kernel
)
// cmake -DCONFIG_SELECTION=NTZ && cmake --build myApp
// cmake -DCONFIG_SELECTION=NS && cmake --build myApp
// new:
set(FREERTOS_PORTS GCC_ARM_CM33_NTZ_NONSECURE GCC_ARM_CM33_NONSECURE)
target_include_directories(freertos_config_ntz INTERFACE ${CMAKE_CURRENT_LIST_DIR}/config/ntz)
target_include_directories(freertos_config_ns INTERFACE ${CMAKE_CURRENT_LIST_DIR}/config/ns)
target_link_libraries(myApp_NTZ
freertos_config_ntz
freertos_kernel_port_GCC_ARM_CM33_NTZ_NONSECURE
)
target_link_libraries(myApp_NS
freertos_config_ns
freertos_kernel_port_GCC_ARM_CM33_NONSECURE
)
// cmake && cmake --build myApp_NTZ myApp_NS
Example port definition in portable/CMakeLists.txt
addPort(GCC_ARM_CM33_NTZ_NONSECURE
WITH_MPU_WRAPPERS
SOURCES
GCC/ARM_CM33_NTZ/non_secure/port.c
GCC/ARM_CM33_NTZ/non_secure/portasm.c
GCC/ARM_CM33_NTZ/non_secure/mpu_wrappers_v2_asm.c
INCLUDE_DIRS
${CMAKE_CURRENT_LIST_DIR}/GCC/ARM_CM33_NTZ/non_secure
)
CMake interface changes:
- Add a configuration variable
FREERTOS_PORTSwhich is a list of all ports which should be available (not all ports can be used with the same compiler). Only the ports which are linked against will actually get built. - For each entry in
FREERTOS_PORTS, there will be a correspondingfreertos_kernel_port_*INTERFACEtarget
Backwards compatibility:
- If
FREERTOS_PORTSis not defined, it defaults to a list with one item equal toFREERTOS_PORTto make the use of multi-ports optional. add_library(freertos_kernel STATIC)links againstfreertos_configandfreertos_kernel_port_${FREERTOS_PORT}ifFREERTOS_PORTis defined to make the use of interface targets optional.
- 主要言語
- C
- スター
- 4.6k
- フォーク
- 1.6k
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FreeRTOS/FreeRTOS-Kernel のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FreeRTOS/FreeRTOS-Kernel#1542 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
FreeRTOS/FreeRTOS-Kernel#1520 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
FreeRTOS/FreeRTOS-Kernel#1494 · コメント 3 件 ·
メンテナーはふだん 3 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
FreeRTOS/FreeRTOS-Kernel#1554 ·
メンテナーはふだん 3 日以内に返信
-
[BUG] event_wait_timed can't return false対応中かも @TedLyngmo が 39 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
FreeRTOS/FreeRTOS-Kernel#1546 ·
メンテナーはふだん 3 日以内に返信
FreeRTOS/FreeRTOS-Kernel の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
FreeRTOS/FreeRTOS-Plus-TCP#1395 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
qoretechnologies/qore#8222 ·
メンテナーはふだん 1 日以内に返信
-
c easy first-contributor first-contributors good first issue help wanted up-for-grabs
難易度 1/5 1〜3時間 初心者へのやさしさ 96/100
fork-commit-merge/fork-commit-merge#8696 ·
メンテナーはふだん 1 日以内に返信