Skip to content
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

CPP definitions from .cabal file not picked up #71

Open
DigitalBrains1 opened this issue Jul 28, 2023 · 3 comments · Fixed by #73
Open

CPP definitions from .cabal file not picked up #71

DigitalBrains1 opened this issue Jul 28, 2023 · 3 comments · Fixed by #73
Labels
bug Something isn't working

Comments

@DigitalBrains1
Copy link

clash-prelude.cabal contains:

Library

  -- See https://github.com/clash-lang/clash-compiler/pull/2511
  if impl(ghc >= 9.4)
    CPP-Options: -DCLASH_OPAQUE=OPAQUE
  else
    CPP-Options: -DCLASH_OPAQUE=NOINLINE

But the doctests output a lot of these:

/builds/clash-lang/clash-compiler/clash-prelude/src/Clash/Magic.hs:51:1: warning: [-Wunrecognised-pragmas]
198    Unrecognised pragma
199   |
20051 | {-# CLASH_OPAQUE prefixName #-}
201   | ^^^

doctest picks some things up from the .cabal file but it's very limited. It would be nice if it could pick this up as well. If this is hard to do, a simple command-line argument to doctest would also suffice; we could always pass that argument to mainFromCabal.

@martijnbastiaan martijnbastiaan added the bug Something isn't working label Jul 28, 2023
@martijnbastiaan
Copy link
Owner

martijnbastiaan commented Jul 29, 2023

Thanks for the report! I've implemented and merged support for --ghc-arg, though I do intend to fix this issue properly too.

See: #72

@martijnbastiaan
Copy link
Owner

Fixed properly in #73.

@martijnbastiaan
Copy link
Owner

Also see: #75.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants