BrianSidebotham/arm-tutorial-rpi

CMake CMAKE_FORCE_C_COMPILER macro is deprecated

Closed this issue · 0 comments

The use of CMAKE_FORCE_C_COMPILER is now deprecated.

Instead, we need to guide CMake to discover the compiler more sanely by letting it come a test program. This will sometimes fail for embedded compilers, especially those without libc. However, in this case we can swap the test compilation to a static library instead of an executable to prevent such failures occurring.

CMake Deprecation Warning at /usr/share/cmake/Modules/CMakeForceCompiler.cmake:75 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /home/bjs/d/github/valvers/arm-tutorial-rpi/compiler/cmake-toolchains/toolchain-arm-none-eabi-rpi4.cmake:33 (CMAKE_FORCE_C_COMPILER)
  /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:93 (include)
  CMakeLists.txt:35 (project)


CMake Deprecation Warning at /usr/share/cmake/Modules/CMakeForceCompiler.cmake:75 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /home/bjs/d/github/valvers/arm-tutorial-rpi/compiler/cmake-toolchains/toolchain-arm-none-eabi-rpi4.cmake:33 (CMAKE_FORCE_C_COMPILER)
  build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:35 (project)

I'm using cmake version 3.18.3