Skip to content

Commit

Permalink
cmake: introduce GCC_COMPILER_VERSION variable
Browse files Browse the repository at this point in the history
Introduce GCC_COMPILER_VERSION to be used in Zephyr CMake when knowledge
of the current GCC Compiler version is needed and
CMAKE_C_COMPILER_VERSION has not been defined yet.

CMAKE_C_COMPILER_VERSION is not defined until project() is called.

Signed-off-by: Torsten Rasmussen <[email protected]>
  • Loading branch information
tejlmand authored and AlexFabre committed Feb 27, 2025
1 parent bc3a01a commit ddca3de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmake/compiler/gcc/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ endif()
# Add check for GCC version >= 13.1
execute_process(
COMMAND ${CMAKE_C_COMPILER} -dumpfullversion
OUTPUT_VARIABLE temp_compiler_version
OUTPUT_VARIABLE GCC_COMPILER_VERSION
)

if("${temp_compiler_version}" VERSION_LESS 4.3.0 OR
"${temp_compiler_version}" VERSION_GREATER_EQUAL 13.1.0)
if("${GCC_COMPILER_VERSION}" VERSION_LESS 4.3.0 OR
"${GCC_COMPILER_VERSION}" VERSION_GREATER_EQUAL 13.1.0)
set(fix_header_file include/limits.h)
else()
set(fix_header_file include-fixed/limits.h)
Expand Down

0 comments on commit ddca3de

Please sign in to comment.