[Feature Request] Flexible CMake configuration
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- c, cmake
- Lĩnh vực
- build-system
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C
- Star
- 4.6k
- Fork
- 1.6k
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FreeRTOS/FreeRTOS-Kernel
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
FreeRTOS/FreeRTOS-Kernel#1542 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[BUG] Release asset FreeRTOS-KernelV11.3.2.zip has the files of main, not of the tag V11.3.2Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
FreeRTOS/FreeRTOS-Kernel#1520 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
FreeRTOS/FreeRTOS-Kernel#1494 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
FreeRTOS/FreeRTOS-Kernel#1554 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[BUG] event_wait_timed can't return falseCó thể đã có người làm @TedLyngmo đã nhận 39 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
FreeRTOS/FreeRTOS-Kernel#1546 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của FreeRTOS/FreeRTOS-Kernel
Issue tương tự
-
RecompLauncher supportĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
shinyquagsire23/OpenJKDF2#540 ·
Maintainer thường phản hồi trong vòng 12 ngày
-
Prison work hall: laundry and kitchen stations stand at bare walls, the hatch has no counter or signĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Life-Framework/Life-Framework#5939 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
autoconf failes to find libsodium even when present due to implicit function declarationCó thể đã có người làm @coderjoe đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 13 ngày
-
SessionInterfaceHandler is throwing a deprecation notice as a warning instead of a deprecationĐang mởBug Status: Needs Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement_package: a site operand of another JSON type raises TypeError, not a named refusalĐang mởbug python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Jstar269/nakagawa-recomp#3521 ·
Maintainer thường phản hồi trong vòng 1 ngày