Skip to content
Commit 6ca2bf25 authored by Torsten Rasmussen's avatar Torsten Rasmussen Committed by Kumar Gala
Browse files

cmake: manual handling of CMakeCheckCompilerFlag.cmake inclusion



Fixes: #30232

This is a workaround for #30232.

During Zephyr CMake invocation a plain C compiler is used for DTS.
This results in the internal `CheckCompilerFlag.cmake` being included
by CMake

Later, when the full toolchain is configured, then
`CMakeCheckCompilerFlag.cmake` is included.
This overloads the `cmake_check_compiler_flag()` function, thus
causing #30232.

By manualy loading `CMakeCheckCompilerFlag.cmake` then
`CheckCompilerFlag.cmake` will overload the functions (and thus win the
battle), and because `include_guard(GLOBAL)` is used in
`CMakeCheckCompilerFlag.cmake` this file will not be re-included later.

It also prints a warning informing the user of the issue.

Signed-off-by: default avatarTorsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
parent 9028ecbc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment