Skip to content

Commit cbb2305

Browse files
committed
cpp-options only for hs
1 parent 15e12b2 commit cbb2305

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Cabal/src/Distribution/Simple/GHC/Internal.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ splitCandCxxOptions
356356
-> LocalBuildInfo
357357
-> BuildInfo
358358
-> ComponentLocalBuildInfo
359-
-> SymbolicPathX 'AllowAbsolute Pkg (Dir Artifacts)
360-
-> SymbolicPathX 'AllowAbsolute Pkg File
359+
-> SymbolicPath Pkg (Dir Artifacts)
360+
-> SymbolicPath Pkg File
361361
-> GhcOptions
362362
splitCandCxxOptions source verbosity lbi bi clbi odir filename = case source of
363363
CxxProgram ->
@@ -453,6 +453,9 @@ sourcesGhcOptions verbosity lbi bi clbi odir filename =
453453
, ghcOptInputFiles = toNubListR [filename]
454454
, ghcOptObjDir = toFlag odir
455455
, ghcOptPackages = toNubListR $ mkGhcOptPackages (promisedPkgs lbi) clbi
456+
, -- cpp-options apply only to .hs files; GHC ignores -optP for non-Haskell
457+
-- files (and since 9.10 this behavior is explicit/enforced)
458+
ghcOptCppOptions = []
456459
}
457460

458461
optimizationCFlags :: LocalBuildInfo -> [String]

changelog.d/11997.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
synopsis: cpp-options apply only to .hs files
3+
packages: [Cabal]
4+
prs: 11997
5+
issues: 11992
6+
---
7+
8+
cpp-options apply only to .hs files; GHC ignores -optP for non-Haskell
9+
files (and since 9.10 this behavior is explicit/enforced)

0 commit comments

Comments
 (0)