Skip to content

Commit 14a2c72

Browse files
committed
CMake: avoid detection of C23 #embed on too old compilers
Related to OSGeo/PROJ#4461
1 parent 29aee5d commit 14a2c72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gdal.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ set(INSTALL_PLUGIN_FULL_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_PLUGIN_DIR}")
266266

267267
function (is_sharp_embed_available res)
268268
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.21 AND
269-
((CMAKE_C_COMPILER_ID STREQUAL "GNU") OR (CMAKE_C_COMPILER_ID STREQUAL "Clang")))
269+
((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) OR
270+
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
270271
# CMAKE_C_STANDARD=23 only supported since CMake 3.21
271272
set(TEST_SHARP_EMBED
272273
"static const unsigned char embedded[] = {\n#embed __FILE__\n};\nint main() { (void)embedded; return 0;}"

0 commit comments

Comments
 (0)