From f65c00f39d4befc8912d9d549ed2b1c96ed90ea6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 1 Oct 2018 17:16:49 +0200 Subject: [PATCH] cmake: Fix -Wattributes check in ConfigureChecks.cmake Signed-off-by: Andreas Schneider --- ConfigureChecks.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index d0868bab..913cebd7 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -276,19 +276,19 @@ int main(void) { ########################################################### # For detecting attributes we need to treat warnings as # errors -if (UNIX) +if (UNIX OR MINGW) # Get warnings for attributs - check_c_compiler_flag("-Wattributs" REQUIRED_FLAGS_WERROR) + check_c_compiler_flag("-Wattributes" REQUIRED_FLAGS_WERROR) if (REQUIRED_FLAGS_WERROR) - set(CMAKE_REQUIRED_FLAGS "-Wattributes") + string(APPEND CMAKE_REQUIRED_FLAGS "-Wattributes ") endif() # Turn warnings into errors check_c_compiler_flag("-Werror" REQUIRED_FLAGS_WERROR) if (REQUIRED_FLAGS_WERROR) - set(CMAKE_REQUIRED_FLAGS "-Werror") + string(APPEND CMAKE_REQUIRED_FLAGS "-Werror ") endif() -endif (UNIX) +endif () check_c_source_compiles(" void test_constructor_attribute(void) __attribute__ ((constructor));