Skip to content

Commit 41ac85a

Browse files
tejlmandfabiobaltieri
authored andcommitted
cmake: introduce GCC_COMPILER_VERSION variable
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]>
1 parent 9f12f8a commit 41ac85a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmake/compiler/gcc/target.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ endif()
3939
# Add check for GCC version >= 13.1
4040
execute_process(
4141
COMMAND ${CMAKE_C_COMPILER} -dumpfullversion
42-
OUTPUT_VARIABLE temp_compiler_version
42+
OUTPUT_VARIABLE GCC_COMPILER_VERSION
4343
)
4444

45-
if("${temp_compiler_version}" VERSION_LESS 4.3.0 OR
46-
"${temp_compiler_version}" VERSION_GREATER_EQUAL 13.1.0)
45+
if("${GCC_COMPILER_VERSION}" VERSION_LESS 4.3.0 OR
46+
"${GCC_COMPILER_VERSION}" VERSION_GREATER_EQUAL 13.1.0)
4747
set(fix_header_file include/limits.h)
4848
else()
4949
set(fix_header_file include-fixed/limits.h)

0 commit comments

Comments
 (0)