summaryrefslogtreecommitdiff
path: root/compileoptions.cmake
diff options
context:
space:
mode:
authorOmair Majid <omair.majid@gmail.com>2017-06-02 16:55:14 -0400
committerJan Vorlicek <janvorli@microsoft.com>2017-06-02 22:55:14 +0200
commitf7ce37729328d4f1061bd8bb52e3eecb0e49486c (patch)
tree9a3022ffed67fcf666259cbaa59393814e38a122 /compileoptions.cmake
parent23126aa5b7d6dc7b58301df7d0af1ccdf805224d (diff)
downloadcoreclr-f7ce37729328d4f1061bd8bb52e3eecb0e49486c.tar.gz
coreclr-f7ce37729328d4f1061bd8bb52e3eecb0e49486c.tar.bz2
coreclr-f7ce37729328d4f1061bd8bb52e3eecb0e49486c.zip
Add support for not breaking *nix build on warnings (#12039)
Add a build flag to make -Werror optional and let the build continue even in the presence of warnings. This option is very useful for anyone compiling with a different (version of the) compiler. A different (version of the) compiler may produce a different set of warnings and a piece of code that compiles without warnings may emit warnings with a different (version of the) compiler. Resolves https://github.com/dotnet/coreclr/issues/8586
Diffstat (limited to 'compileoptions.cmake')
-rw-r--r--compileoptions.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/compileoptions.cmake b/compileoptions.cmake
index 75d51fd5bb..718e9d34f1 100644
--- a/compileoptions.cmake
+++ b/compileoptions.cmake
@@ -23,8 +23,10 @@ if (CLR_CMAKE_PLATFORM_UNIX)
# after hitting just about 20 errors.
add_compile_options(-ferror-limit=4096)
- # All warnings that are not explicitly disabled are reported as errors
- add_compile_options(-Werror)
+ if (CLR_CMAKE_WARNINGS_ARE_ERRORS)
+ # All warnings that are not explicitly disabled are reported as errors
+ add_compile_options(-Werror)
+ endif(CLR_CMAKE_WARNINGS_ARE_ERRORS)
# Disabled warnings
add_compile_options(-Wno-unused-private-field)