From c4fdda23861b2a9803e8743dac71211eb24ae372 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 28 Aug 2022 12:00:15 -0400 Subject: [PATCH] makefile,spline3.cabal: move ghc-options to the makefile. --- makefile | 20 ++++++++++++++++--- spline3.cabal | 53 --------------------------------------------------- 2 files changed, 17 insertions(+), 56 deletions(-) diff --git a/makefile b/makefile index 8c0aab4..12779b2 100644 --- a/makefile +++ b/makefile @@ -6,19 +6,33 @@ BIN = dist/build/spline3/spline3 DOCTESTS_BIN = dist/build/doctests/doctests TESTSUITE_BIN = dist/build/testsuite/testsuite +# Append these warnings to the HCFLAGS environment variable that gets +# passed as options to GHC. We want to see the warnings while developing +# but don't want them hard-coded in the cabal file for end users. +HCFLAGS += -Weverything \ + -Wno-implicit-prelude \ + -Wno-safe \ + -Wno-unsafe \ + -Wno-all-missed-specialisations \ + -Wno-prepositive-qualified-module \ + -Wno-missing-safe-haskell-mode \ + -Wno-missing-deriving-strategies \ + -rtsopts \ + -threaded + .PHONY : test doc dist hlint $(BIN): $(PN).cabal $(SRCS) runghc Setup.hs configure --user --prefix=/ - runghc Setup.hs build + runghc Setup.hs build --ghc-options="${HCFLAGS}" $(DOCTESTS_BIN): $(SRCS) test/Doctests.hs runghc Setup.hs configure --user --prefix=/ --enable-tests - runghc Setup.hs build + runghc Setup.hs build --ghc-options="${HCFLAGS}" $(TESTSUITE_BIN): $(SRCS) test/TestSuite.hs runghc Setup.hs configure --user --prefix=/ --enable-tests - runghc Setup.hs build + runghc Setup.hs build --ghc-options="${HCFLAGS}" clean: runghc Setup.hs clean diff --git a/spline3.cabal b/spline3.cabal index 2e10996..4ff6891 100644 --- a/spline3.cabal +++ b/spline3.cabal @@ -75,25 +75,6 @@ executable spline3 Values Volumetric - ghc-options: - -Weverything - -Wno-implicit-prelude - -Wno-safe - -Wno-unsafe - -Wno-all-missed-specialisations - -funbox-strict-fields - -fexcess-precision - -fno-spec-constr-count - -rtsopts - -threaded - -O2 - -optc-O3 - -optc-march=native - - ghc-prof-options: - -auto-all - -caf-all - test-suite doctests type: exitcode-stdio-1.0 @@ -104,22 +85,6 @@ test-suite doctests -- Additional test dependencies. doctest >= 0.9 - -- It's not entirely clear to me why I have to reproduce all of this. - ghc-options: - -Weverything - -Wno-implicit-prelude - -Wno-safe - -Wno-unsafe - -Wno-all-missed-specialisations - -rtsopts - -threaded - -funbox-strict-fields - -fexcess-precision - -fno-spec-constr-count - -O2 - -optc-O3 - -optc-march=native - test-suite testsuite type: exitcode-stdio-1.0 @@ -156,24 +121,6 @@ test-suite testsuite tasty-hunit >= 0.8, tasty-quickcheck >= 0.8.1 - -- It's not entirely clear to me why I have to reproduce all of this. - ghc-options: - -Weverything - -Wno-implicit-prelude - -Wno-safe - -Wno-unsafe - -Wno-all-missed-specialisations - -rtsopts - -threaded - -funbox-strict-fields - -fexcess-precision - -fno-spec-constr-count - - ghc-options: - -O2 - -optc-O3 - -optc-march=native - source-repository head type: git -- 2.43.2