summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Diamond <wichard@vitalitystudios.com>2018-02-27 18:29:15 -0600
committerAlon Zakai <alonzakai@gmail.com>2018-02-27 16:29:15 -0800
commit01098f1288d37058b5fbac50468a1b07408d6dec (patch)
tree2be89978bfe3ee51377ebb7084372c6d69221b40
parent89daa028fec6b627f1cbad3285b3176361f36e3d (diff)
downloadbinaryen-01098f1288d37058b5fbac50468a1b07408d6dec.tar.gz
binaryen-01098f1288d37058b5fbac50468a1b07408d6dec.tar.bz2
binaryen-01098f1288d37058b5fbac50468a1b07408d6dec.zip
Allow disabling `-Werror`. (#1445)
`-Werror` and the warnings provided by any specific toolchain/compiler are not standard.
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32d3ce37a..433205f44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,9 @@ IF(MSVC)
ADD_DEFINITIONS(/analyze)
ENDIF()
ELSE()
+
+ OPTION(ENABLE_WERROR "Enable -Werror" ON)
+
SET(THREADS_PREFER_PTHREAD_FLAG ON)
SET(CMAKE_THREAD_PREFER_PTHREAD ON)
FIND_PACKAGE(Threads REQUIRED)
@@ -112,7 +115,9 @@ ELSE()
endif ()
endif ()
ADD_COMPILE_FLAG("-Wall")
- ADD_COMPILE_FLAG("-Werror")
+ if(ENABLE_WERROR)
+ ADD_COMPILE_FLAG("-Werror")
+ endif()
ADD_COMPILE_FLAG("-Wextra")
ADD_COMPILE_FLAG("-Wno-unused-parameter")
ADD_COMPILE_FLAG("-fno-omit-frame-pointer")