Skip to content

Shared BuildInfo between targets #1949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rudymatela opened this issue Jun 16, 2014 · 5 comments
Closed

Shared BuildInfo between targets #1949

rudymatela opened this issue Jun 16, 2014 · 5 comments

Comments

@rudymatela
Copy link
Contributor

A nice feature to add would be to share properties between targets. A common thing to see (even in cabal's .cabal file):

library
  exposed-modules: Blah, Bleh
  ghc-options: -Wall -Wsomething
  default-language: Haskell 2010
  if flag(debug)
    cpp-options: -DDEBUG

Test-Suite test
  ...
  ghc-options: -Wall -Wsomething
  default-language: Haskell 2010
  if flag(debug)
    cpp-options: -DDEBUG

Executable blah
  ...
  ghc-options: -Wall -Wsomething
  default-language: Haskell 2010
  if flag(debug)
    cpp-options: -DDEBUG

It would be nice to be able to declare the 4 lines as a set of options and just reference them on the different targets. With the new .cabal looking more or less like:

Common-Properties commonflags
  ghc-options: -Wall -Wsomething
  default-language: Haskell 2010
  if flag(debug)
    cpp-options: -DDEBUG

library
  exposed-modules: Blah, Bleh
  include-properties: commonflags

Test-Suite test
  ...
  include-properties: commonflags

Executable blah
  ...
  include-properties: commonflags
@ttuegel ttuegel changed the title Share properties between targets Shared BuildInfo between targets Apr 24, 2015
@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 24, 2015
@rudymatela
Copy link
Contributor Author

By the way, I've seen a few posts on stackoverflow related to this issue:

@ulysses4ever
Copy link
Collaborator

Should this be closed in the light of common stanzas? (#4751, bfb1967, possible dup of #2832)

@Mikolaj
Copy link
Member

Mikolaj commented Sep 30, 2022

@rudymatela: would you like to comment? Alternatively, we can close this ticket and you are very welcome to open a new one once you have the time to investigate the new cabal feature that plausibly solves this issue.

@rudymatela
Copy link
Contributor Author

@ulysses4ever @Mikolaj I did not test the common stanzas feature, but by reading the relevant tickets (#4751, #2832) they seem to resolve this issue.

Thanks for addressing this!

I will close now.

@Mikolaj
Copy link
Member

Mikolaj commented Oct 17, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants