summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-08-13 20:17:00 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-13 22:12:21 +0200
commit1e17e084bf56f5c1b609c0cf0d715a1a7c528fab (patch)
treeb35336b2a6875a3aa521808bdc36e9367bc51e63
parenta2c14c5ec55d9ebacd108835fc248ca5be18388b (diff)
downloadlibssh-1e17e084bf56f5c1b609c0cf0d715a1a7c528fab.tar.gz
libssh-1e17e084bf56f5c1b609c0cf0d715a1a7c528fab.tar.xz
libssh-1e17e084bf56f5c1b609c0cf0d715a1a7c528fab.zip
cmake: Only set -Werror on UNIX
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 6aa9392699f9cc2d75565e7e6d713e270accecb9)
-rw-r--r--ConfigureChecks.cmake4
1 files changed, 3 insertions, 1 deletions
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));