From 6aa9392699f9cc2d75565e7e6d713e270accecb9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 13 Aug 2018 20:17:00 +0200 Subject: [PATCH] cmake: Only set -Werror on UNIX Signed-off-by: Andreas Schneider --- ConfigureChecks.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index a92dcc5f..650119cb 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -270,7 +270,9 @@ int main(void) { ########################################################### # For detecting attributes we need to treat warnings as # errors -set(CMAKE_REQUIRED_FLAGS "-Werror") +if (UNIX) + set(CMAKE_REQUIRED_FLAGS "-Werror") +endif (UNIX) check_c_source_compiles(" void test_constructor_attribute(void) __attribute__ ((constructor));