[bug] CMakeToolchain does not properly set CMAKE_TRY_COMPILE_TARGET_TYPE for bare metal targets
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9.5k
- Forks
- 1.1k
- Avg merge
- 23h 48m
- Merged PRs (30d)
- 15
Description
Environment Details (include every applicable attribute)
- Operating System+version: Fedora Silverblue 35
- Compiler+version: GCC 11
- Conan version: 1.41.0
- Python version: 3.10
Steps to reproduce (Include if Applicable)
For bare metal targets, CMakeToolchain does not set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY which is necessary for CMake to function when building for targets which do not have an operating system and therefore dynamic linking.
CMake will choke during the configure stage for such a target when checking the compiler.
It would probably be necessary to add a bare architecture setting in order to detect this scenario, which has been proposed in issue #4216.
This issue is also relevant to issue #9663
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the CMakeToolchain implementation and review how compiler checks are configured for bare metal targets. Reproduce the configure-stage failure with the stated Conan, CMake, GCC, and Fedora environment, then verify that bare metal configuration sets CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY without affecting other targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100