summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-04-02 11:41:47 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-04-02 11:41:51 +0200
commit4c1e1c870e294990a44d8d6837742fb0d00f5456 (patch)
treec673444cd16216de6cc70654beb5b6f49fd21094 /ghc.mk
parent9b66a7f3d04ed93972e7daa1c6307c8d68ac3720 (diff)
downloadhaskell-4c1e1c870e294990a44d8d6837742fb0d00f5456.tar.gz
Disable same warnings for normal builds as for validate (#10223)
The default validate settings currently disable some warnings in the libraries. This patch moves those settings to a new file called `mk/warnings.mk`, and applies them also to normal builds. Through uncommenting a line in build.mk, developers can now build with -Werror. -Werror is not the default, because: * We can not guarantee that the build is warning free on platforms we don't run regularly run validate (as part of continuous integration systems), and we still want the build to go through on those platforms. * quoting rwbarton on irc > "I think -Werror by default has come up in the past and the argument was that it is too annoying when you are doing nontrivial development" Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D785
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk15
1 files changed, 8 insertions, 7 deletions
diff --git a/ghc.mk b/ghc.mk
index 760ace25ff..3638a1ba62 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -148,9 +148,12 @@ endif
endif
include mk/ways.mk
+include mk/warnings.mk
# (Optional) build-specific configuration
include mk/custom-settings.mk
+SRC_CC_OPTS += $(WERROR)
+SRC_HC_OPTS += $(WERROR)
ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
ifeq "$(DYNAMIC_GHC_PROGRAMS)" "YES"
@@ -694,17 +697,15 @@ stage1_libs : $(ALL_STAGE1_LIBS)
# ----------------------------------------------
# Per-package compiler flags
#
-# If you want to add per-package compiler flags, this
-# is the place to do it. Do it like this for package <pkg>
-#
-# libraries/<pkg>_dist-boot_HC_OPTS += -Wwarn
-# libraries/<pkg>_dist-install_HC_OPTS += -Wwarn
+# If you want to add per-package compiler flags, see `mk/warnings.mk`.
-# Add $(GhcLibHcOpts) to all package builds
+# Add $(GhcLib(Extra)HcOpts) to all package builds
$(foreach pkg,$(PACKAGES_STAGE1) $(PACKAGES_STAGE2),$(eval libraries/$(pkg)_dist-install_HC_OPTS += $$(GhcLibHcOpts)))
+$(foreach pkg,$(PACKAGES_STAGE1) $(PACKAGES_STAGE2),$(eval libraries/$(pkg)_dist-install_EXTRA_HC_OPTS += $$(GhcLibExtraHcOpts)))
-# Add $(GhcBootLibHcOpts) to all stage0 package builds
+# Add $(GhcBootLib(Extra)HcOpts) to all stage0 package builds
$(foreach pkg,$(PACKAGES_STAGE0),$(eval libraries/$(pkg)_dist-boot_HC_OPTS += $$(GhcBootLibHcOpts)))
+$(foreach pkg,$(PACKAGES_STAGE0),$(eval libraries/$(pkg)_dist-boot_EXTRA_HC_OPTS += $$(GhcBootLibExtraHcOpts)))
# -----------------------------------------------------------------------------
# Bootstrapping libraries