Skip to content

Commit

Permalink
Add additional patches for a more warning-free build
Browse files Browse the repository at this point in the history
  • Loading branch information
wdoekes committed May 1, 2022
1 parent cb3be49 commit 21d55e6
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
25 changes: 25 additions & 0 deletions patches/silence_cmake_force_cxx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Author: wdoekes
Date: 2022-05-01
Description: silence CMake complaining about CMAKE_FORCE_CXX_COMPILER
It sure looks like more cmake code could be removed, but replacing this
silences these warnings:
CMake Deprecation Warning at 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.

--- a/yotta_targets/mbed-gcc/CMake/toolchain.cmake 2022-05-01 18:41:02.312968861 +0200
+++ b/yotta_targets/mbed-gcc/CMake/toolchain.cmake 2022-05-01 18:46:50.216029108 +0200
@@ -72,11 +72,8 @@ set(CMAKE_MODULE_LINKER_FLAGS_INIT
)
set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} -Wl,-wrap,main")

-# Set the compiler to ARM-GCC
-include(CMakeForceCompiler)
-
-cmake_force_c_compiler("${ARM_NONE_EABI_GCC}" GNU)
-cmake_force_cxx_compiler("${ARM_NONE_EABI_GPP}" GNU)
+set(CMAKE_C_COMPILER arm-none-eabi-gcc)
+set(CMAKE_CXX_COMPILER arm-none-eabi-g++)

# post-process elf files into .bin files:
function(yotta_apply_target_rules target_type target_name)
20 changes: 20 additions & 0 deletions patches/silence_cmake_yotta_cmp0017.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Author: wdoekes
Date: 2022-05-01
Description: silence CMake complaining about CMP0017 being removed
I'm not sure if we need that CMP0017 ordering. Without it, the build
still works, so removing might be fine. Before, we had these warnings:
CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
The OLD behavior for policy CMP0017 will be removed from a future version
of CMake.

--- /usr/share/yotta/yotta/lib/templates/base_CMakeLists.txt 2022-05-01 18:44:50.864336461 +0200
+++ /usr/share/yotta/yotta/lib/templates/base_CMakeLists.txt 2022-05-01 18:44:54.640326530 +0200
@@ -14,7 +14,7 @@ add_custom_target(all_tests)

# always use the CMAKE_MODULE_PATH-provided .cmake files, even when including
# from system directories:
-cmake_policy(SET CMP0017 OLD)
+#cmake_policy(SET CMP0017 OLD)

# toolchain file for {{ target_name }}
set(CMAKE_TOOLCHAIN_FILE "{{ toolchain_file | replaceBackslashes }}")

0 comments on commit 21d55e6

Please sign in to comment.