No known features for CXX compiler "GNU" version 12.3.1 (arm-none-eabi)

Hi,

We are cross-compiling C++20 for an ARM AArch32 bare-metal target (arm-none-eabi). This usually works fine. However, when we try to include the fmt library (GitHub - fmtlib/fmt: A modern formatting library version 10.2.1), with

find_package(fmt CONFIG REQUIRED)
target_link_libraries(${TARGET_NAME} PUBLIC fmt::fmt)

we get the following error message:
[cmake] No known features for CXX compiler
[cmake]
[cmake] “GNU”
[cmake]
[cmake] version 12.3.1.
[cmake]
[cmake]
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.

We use the compiler arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi with the following toolchain file: mcux-sdk/tools/cmake_toolchain_files/armgcc.cmake at a6bf851f65020c437704e53d2d9587ae21789d65 · nxp-mcuxpresso/mcux-sdk · GitHub

I tried with the latest CMake 3.29.2, but that did not help.

Any ideas on how to fix this?

Thanks,
Björn

1 Like

I see a very similar issue trying to compile Boost with an arm-non-eabi compiler with CMake version 3.29.3. I also saw the same issue above with the fmt library. Any update on this issue?

No solution yet.

Any updates to share? Or input from Kitware?

In our particular case, it looks like these options in our toolchain file were the offenders causing this issue. Removing them fixed my similar issue. I don’t know if we add this mistakenly or the STM32 CMake generation did.

set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)

No updates unfortunately. We did a “hacky” workaround.

Great that you found a way to solve it for your case. I will investigate that. Thanks!

Removing those lines is the solution.
Forcing a compiler disables information gathering of CMake.

Forcing a compiler is deprecated, please see the module doc for details.

1 Like