Skip to content

Commit f580364

Browse files
github-actions[bot]am11akoeplinger
authored
Conditionally check the compiler flags in libs.native (#109556)
Co-authored-by: Adeel Mujahid <[email protected]> Co-authored-by: Alexander Köplinger <[email protected]>
1 parent 6001638 commit f580364

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/native/libs/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,14 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
123123
add_compile_options(-Wno-empty-translation-unit)
124124
add_compile_options(-Wno-cast-align)
125125
add_compile_options(-Wno-typedef-redefinition)
126-
add_compile_options(-Wno-c11-extensions)
127-
add_compile_options(-Wno-pre-c11-compat) # fixes build on Debian
128-
add_compile_options(-Wno-unknown-warning-option) # unknown warning option '-Wno-pre-c11-compat'
129126
add_compile_options(-Wno-thread-safety-analysis)
127+
add_compile_options(-Wno-c11-extensions)
128+
129+
check_c_compiler_flag(-Wpre-c11-compat COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
130+
if (COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
131+
add_compile_options(-Wno-pre-c11-compat)
132+
endif()
133+
130134
if (CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
131135
add_compile_options(-Wno-unsafe-buffer-usage)
132136
add_compile_options(-Wno-cast-function-type-strict)

0 commit comments

Comments
 (0)