diff --git a/src/Native/Unix/CMakeLists.txt b/src/Native/Unix/CMakeLists.txt index f1d6a9ac599b..d2f7540926d9 100644 --- a/src/Native/Unix/CMakeLists.txt +++ b/src/Native/Unix/CMakeLists.txt @@ -247,6 +247,13 @@ endfunction() include(configure.cmake) +if (HAVE_WNO_ALLOCA) + add_compile_options(-Wno-alloca) +endif() +if (HAVE_WNO_IMPLICIT_INT_FLOAT_CONVERSION) + add_compile_options(-Wno-implicit-int-float-conversion) +endif() + if (NOT CLR_CMAKE_PLATFORM_WASM) add_subdirectory(System.IO.Compression.Native) add_subdirectory(System.IO.Ports.Native) diff --git a/src/Native/Unix/configure.cmake b/src/Native/Unix/configure.cmake index 061c40e6a64a..6756ea26a5e3 100644 --- a/src/Native/Unix/configure.cmake +++ b/src/Native/Unix/configure.cmake @@ -1,3 +1,4 @@ +include(CheckCCompilerFlag) include(CheckCSourceCompiles) include(CheckCSourceRuns) include(CheckFunctionExists) @@ -31,6 +32,9 @@ endif () # which are not distinguished from the test failing. So no error for that one. set(CMAKE_REQUIRED_FLAGS "-Werror -Wno-error=unused-value") +check_c_compiler_flag(-Wno-alloca HAVE_WNO_ALLOCA) +check_c_compiler_flag(-Wno-implicit-int-float-conversion HAVE_WNO_IMPLICIT_INT_FLOAT_CONVERSION) + # in_pktinfo: Find whether this struct exists check_include_files( "sys/socket.h;linux/in.h"