BrianSidebotham / arm-tutorial-rpi

Raspberry-Pi Bare Metal Programming in C Tutorial
https://www.valvers.com/open-software/raspberry-pi/bare-metal-programming-in-c-part-1/
MIT License
587 stars 177 forks source link

CMake CMAKE_FORCE_C_COMPILER macro is deprecated #35

Closed BrianSidebotham closed 3 years ago

BrianSidebotham commented 3 years ago

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