-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i.e. Do not warn on -O2 if flag conditional
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlag/cabal.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# cabal check | ||
No errors or warnings could be found in the package. |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlag/cabal.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Do not output warning when an -O2 is behind a cabal flag. | ||
main = cabalTest $ cabal "check" [] |
18 changes: 18 additions & 0 deletions
18
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlag/pkg.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cabal-version: 2.2 | ||
name: pkg | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
synopsis: synopsys | ||
description: description | ||
license: GPL-3.0-or-later | ||
|
||
flag force-O2 | ||
default: False | ||
manual: True | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
if flag(force-O2) | ||
ghc-options: -O2 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/cabal.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit and not just imposing longer compile times on your users. | ||
|
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/cabal.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Test.Cabal.Prelude | ||
|
||
-- Do not output warning when an -O2 is behind a cabal flag. | ||
main = cabalTest $ cabal "check" [] |
19 changes: 19 additions & 0 deletions
19
cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/pkg.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cabal-version: 2.2 | ||
name: pkg | ||
version: 0 | ||
category: example | ||
maintainer: none@example.com | ||
synopsis: synopsys | ||
description: description | ||
license: GPL-3.0-or-later | ||
|
||
flag force-O2 | ||
default: False | ||
manual: True | ||
|
||
library | ||
exposed-modules: Foo | ||
default-language: Haskell2010 | ||
ghc-options: -O2 | ||
if flag(force-O2) | ||
ghc-options: -O2 |