compiler: gcc: Support versions predating include-fixed/limits.h

GCC versions starting from 4.3.0 until 12.4.0 stored the limits.h header in
a directory named include-fixed/ . Before 4.3.0 and after 12.4.0 i.e. from
13.1.0 onward, the header is stored in a directory named include/ .

Previously, target.cmake would only detect if the GCC version was 13.1.0 or
newer. This patch adds a check to also check if it is older than 4.3.0.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
This commit is contained in:
Joel Holdsworth 2025-01-07 15:23:14 -08:00 committed by Benjamin Cabé
commit 46e37b00e7

View file

@ -42,7 +42,8 @@ execute_process(
OUTPUT_VARIABLE temp_compiler_version
)
if("${temp_compiler_version}" VERSION_GREATER_EQUAL 13.1.0)
if("${temp_compiler_version}" VERSION_LESS 4.3.0 OR
"${temp_compiler_version}" VERSION_GREATER_EQUAL 13.1.0)
set(fix_header_file include/limits.h)
else()
set(fix_header_file include-fixed/limits.h)