cmake: Only set -Werror on UNIX

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 6aa9392699)
This commit is contained in:
Andreas Schneider
2018-08-13 20:17:00 +02:00
parent a2c14c5ec5
commit 1e17e084bf

View File

@@ -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));