Skip to content

[HELP] Usage of CMAKE_SYSTEM_PROCESSOR #16003

@no1wudi

Description

@no1wudi

Description

I have a question. It seems that many other projects use the architecture name as the value for CMAKE_SYSTEM_PROCESSOR. For example, for Cortex-M0, it should be set to armv6m. However, if we directly set it to the CPU type now, we may encounter compatibility issues with some libraries:

if(CONFIG_ARCH_CORTEXM0)
set(CMAKE_SYSTEM_PROCESSOR cortex-m0)
elseif(CONFIG_ARCH_CORTEXM3)
set(CMAKE_SYSTEM_PROCESSOR cortex-m3)
elseif(CONFIG_ARCH_CORTEXM4)
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
elseif(CONFIG_ARCH_CORTEXM7)

For the 3rd party lib, such as iree and openamp
https://github.com/iree-org/iree/blob/6cdb40cf6ebe1eea457dc4bd5bbdb9d1a60ad5a0/build_tools/cmake/iree_macros.cmake#L49-L72

https://github.com/OpenAMP/open-amp/blob/8c0c0c386b5799b54faf9613a191f66dee76e400/README.md?plain=1#L173

Should we modify the definition to this more commonly used form? Doing so could improve compatibility with other 3rd party libraries.

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions