Skip to content

CPP definitions from .cabal file not picked up #71

@DigitalBrains1

Description

@DigitalBrains1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions