Skip to content

Commit bf14685

Browse files
committed
[mlir] Change deprecated -Werror-implicit-function-declaration to -Werror=implicit-function-declaration
This -Werror- form has been deprecated since 2007 (GCC r122017). And only enable it for CMAKE_C_FLAGS. C++ does not need it.
1 parent 1dad9d4 commit bf14685

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ include(AddMLIR)
1212

1313
# Forbid implicit function declaration: this may lead to subtle bugs and we
1414
# don't have a reason to support this.
15-
add_flag_if_supported("-Werror-implicit-function-declaration" WERROR_IMPLICIT_FUNCTION_DECLARATION)
15+
check_c_compiler_flag("-Werror=implicit-function-declaration" C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION)
16+
append_if(C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION "-Werror=implicit-function-declaration" CMAKE_C_FLAGS)
1617

1718
# Installing the headers and docs needs to depend on generating any public
1819
# tablegen'd targets.

0 commit comments

Comments
 (0)