InfiniTimeOrg / InfiniTimeOrg/InfiniTime
CMake detecting system toolchain
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Verification
- I searched for similar issues and found none was relevant.
Introduce the issue
When generating the project, CMake claims the compiler in use is one from the system, not the arm crosscompiler. I don't know if this causes side-effects, but it seems incorrect nonetheless.
Output from a build workflow.
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Preferred solution
Moving the inclusion of the toolchain file earlier seems to fix the issue, but I'm not very familiar with CMake, so I want to give an opportunity to someone who knows better to look at it and find a good solution to this issue. This can be an opportunity to also check the structure of the CMake files, which seems like it might be quite outdated.
Version
No response
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 by inspecting the CMake files and the toolchain file, then reproduce project generation from the build workflow that reports /usr/bin/cc and /usr/bin/c++. Check when the toolchain file is included relative to compiler detection. Done means CMake identifies and uses the ARM crosscompiler instead of the system compiler, with the workflow output confirming the change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake, cpp
- Domain
- build-system, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100