Skip to content

Commit 363b78a

Browse files
hololeapjneira
authored andcommitted
ghcide: Add flags to toggle building each executable (haskell#2212)
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. All three are enabled by default. `executable`: * Toggles the `ghcide` executable `test-exe`: * Toggles the `ghcide-test-preprocessor` executable `bench-exe`: * Toggles the `ghcide-bench` executable Co-authored-by: Javier Neira <[email protected]>
1 parent 338f4d4 commit 363b78a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ghcide/ghcide.cabal

+21
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ library
217217
exposed-modules:
218218
Development.IDE.GHC.Compat.CPP
219219

220+
flag test-exe
221+
description: Build the ghcide-test-preprocessor executable
222+
default: True
223+
220224
executable ghcide-test-preprocessor
221225
default-language: Haskell2010
222226
hs-source-dirs: test/preprocessor
@@ -225,6 +229,9 @@ executable ghcide-test-preprocessor
225229
build-depends:
226230
base == 4.*
227231

232+
if !flag(test-exe)
233+
buildable: False
234+
228235
benchmark benchHist
229236
type: exitcode-stdio-1.0
230237
default-language: Haskell2010
@@ -263,6 +270,10 @@ benchmark benchHist
263270
text,
264271
yaml
265272

273+
flag executable
274+
description: Build the ghcide executable
275+
default: True
276+
266277
executable ghcide
267278
default-language: Haskell2010
268279
hs-source-dirs: exe
@@ -322,6 +333,9 @@ executable ghcide
322333
TypeApplications
323334
ViewPatterns
324335

336+
if !flag(executable)
337+
buildable: False
338+
325339
test-suite ghcide-tests
326340
type: exitcode-stdio-1.0
327341
default-language: Haskell2010
@@ -404,6 +418,10 @@ test-suite ghcide-tests
404418
TypeApplications
405419
ViewPatterns
406420

421+
flag bench-exe
422+
description: Build the ghcide-bench executable
423+
default: True
424+
407425
executable ghcide-bench
408426
default-language: Haskell2010
409427
build-tool-depends:
@@ -448,3 +466,6 @@ executable ghcide-bench
448466
TupleSections
449467
TypeApplications
450468
ViewPatterns
469+
470+
if !flag(bench-exe)
471+
buildable: False

0 commit comments

Comments
 (0)