Tim
Tim

Reputation: 2796

Defining an Executable in Cabal that is Not Installed

Is there a cabal attribute of executable that means "don't install this executable".

E.g. in myproject.cabal I would have:

executable install_exe
   ...
executable support_exe -- not to be installed via cabal install
   install: False

EDIT: I realize I can might be able to say something from the command line to just get that one, but I am looking for something that can be defaulted in the cabal file.

Thanks!

Upvotes: 2

Views: 78

Answers (1)

Daniel Wagner
Daniel Wagner

Reputation: 153172

You may use buildable: False inside the executable stanza to instruct cabal not to build support_exe. If you want a way to enable it in certain circumstances, you can protect this clause with a build flag. An incomplete example follows.

flag support
    description: Build and install supporting executables
    default: False

executable support_exe
    if !flag(support)
        buildable: False

Upvotes: 4

Related Questions