Skip to content

Commit 163004a

Browse files
MichaelSimonsam11
authored andcommitted
Update src/native/libs/CMakeLists.txt
Co-authored-by: Adeel Mujahid <[email protected]>
1 parent 05fb9dc commit 163004a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/native/libs/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
128128
add_compile_options(-Wno-cast-align)
129129
add_compile_options(-Wno-typedef-redefinition)
130130
add_compile_options(-Wno-c11-extensions)
131-
add_compile_options(-Wno-pre-c11-compat) # fixes build on Debian
132-
add_compile_options(-Wno-unknown-warning-option) # unknown warning option '-Wno-pre-c11-compat'
131+
132+
check_c_compiler_flag(-Wpre-c11-compat COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
133+
if (COMPILER_SUPPORTS_W_PRE_C11_COMPAT)
134+
add_compile_options(-Wno-pre-c11-compat)
135+
endif()
136+
133137
add_compile_options(-Wno-thread-safety-analysis)
134138
if (CLR_CMAKE_TARGET_BROWSER)
135139
add_compile_options(-Wno-unsafe-buffer-usage)

0 commit comments

Comments
 (0)