Open-CMSIS-Pack / cmsis-toolbox

CMSIS-Toolbox
https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/README.md#cmsis-toolbox
Apache License 2.0
64 stars 15 forks source link

[Bug?]: Toolchain Prefix/Suffix Support #95

Closed 424778940z closed 8 months ago

424778940z commented 9 months ago

Is there an existing issue for this?

Unusable feature

It cannot build the solution as it's using the wrong compiler, and there seems no way to change it

Current Behavior

I have multiple GCC toolchains in PATH, currently there seems no way to chose between them, it always grub the gcc instaead of arm-none-eabi-gcc

Expected Behavior

look at the cmake ext, give an option to chose what kit the user wants. or at least give a way to override in config files

Steps To Reproduce

No response

Affected tools

Affected operating systems

Environment

No response

jkrech commented 9 months ago

CMake is offering the fallback option to pick a gcc compiler from your path. This is not recommended. Instead please follow the instructions for Toolchain Registration

jkrech commented 8 months ago

Please reopen the issue in case registering the GCC compiler using an environment variable GCC_TOOLCHAIN_<major>_<minor>_<patch> containing the absolute path to the bin directory of the GCC compiler installation does not solve the above problem.

purdurnr commented 8 months ago

The same situation occurred with my laptop setup. Having several GCC compilers, the cbuild selected incorrect version. Correcting path/environment variables resolved problem. However, I would like to propose that a version of compiler be added to the cSolution spec. The current spec allows user to specify/lock versions of Software Packs. I believe it may be beneficial if user could specify/lock version of compiler that has been tested. This will prevent a user from running with "C-Compiler" without knowing what version was used in the tested case. This also avoids issues with Environment Variables being configured through different setup processes (NXP, ARM, IAR...) Currently the cBuild outputs a "Warning". Possibly update the Warning to list the suggested version from cSolution.

jkrech commented 8 months ago

#1276 is intended to ensure environment variables are configured for the toolchains being used and therefore cbuild becomes independent from the user's $PATH / %PATH%.