Skip to content

Commit

Permalink
ghcide: Add flags to toggle building each executable
Browse files Browse the repository at this point in the history
This package is a transient dependency of `haskell-language-server`.
However, only the library is needed. These three flags give the option for
those who do not need the executables to disable them.

`executable`:
* Toggles the `ghcide` executable
* enabled by default.

`test-exe`:
* Toggles the `ghcide-test-preprocessor` executable
* disabled by default

`bench-exe`:
* Toggles the `ghcide-bench` executable
* disabled by default
  • Loading branch information
hololeap committed Sep 19, 2021
1 parent 597bee9 commit e9ef9e3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ library
exposed-modules:
Development.IDE.GHC.Compat.CPP

flag test-exe
description: Build the ghcide-test-preprocessor executable
default: False

executable ghcide-test-preprocessor
default-language: Haskell2010
hs-source-dirs: test/preprocessor
Expand All @@ -225,6 +229,9 @@ executable ghcide-test-preprocessor
build-depends:
base == 4.*

if !flag(test-exe)
buildable: False

benchmark benchHist
type: exitcode-stdio-1.0
default-language: Haskell2010
Expand Down Expand Up @@ -263,6 +270,10 @@ benchmark benchHist
text,
yaml

flag executable
description: Build the ghcide executable
default: True

executable ghcide
default-language: Haskell2010
hs-source-dirs: exe
Expand Down Expand Up @@ -322,6 +333,9 @@ executable ghcide
TypeApplications
ViewPatterns

if !flag(executable)
buildable: False

test-suite ghcide-tests
type: exitcode-stdio-1.0
default-language: Haskell2010
Expand Down Expand Up @@ -404,6 +418,10 @@ test-suite ghcide-tests
TypeApplications
ViewPatterns

flag bench-exe
description: Build the ghcide-bench executable
default: False

executable ghcide-bench
default-language: Haskell2010
build-tool-depends:
Expand Down Expand Up @@ -448,3 +466,6 @@ executable ghcide-bench
TupleSections
TypeApplications
ViewPatterns

if !flag(bench-exe)
buildable: False

0 comments on commit e9ef9e3

Please sign in to comment.