From f515dbc79006a86184e829917975406d3fa8b5d6 Mon Sep 17 00:00:00 2001 From: hololeap Date: Sat, 18 Sep 2021 22:33:47 -0600 Subject: [PATCH] ghcide: Add flags to toggle building each executable 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 --- ghcide/ghcide.cabal | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index 820107f7d9..f807faa227 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -217,6 +217,10 @@ library exposed-modules: Development.IDE.GHC.Compat.CPP +flag test-exe + description: Build the ghcide-test-preprocessor executable + default: True + executable ghcide-test-preprocessor default-language: Haskell2010 hs-source-dirs: test/preprocessor @@ -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 @@ -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 @@ -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 @@ -404,6 +418,10 @@ test-suite ghcide-tests TypeApplications ViewPatterns +flag bench-exe + description: Build the ghcide-bench executable + default: True + executable ghcide-bench default-language: Haskell2010 build-tool-depends: @@ -448,3 +466,6 @@ executable ghcide-bench TupleSections TypeApplications ViewPatterns + + if !flag(bench-exe) + buildable: False