Skip to content

Commit 4d8e74a

Browse files
committed
Add #if for GHC >=810
1 parent c3e68be commit 4d8e74a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE FlexibleContexts #-}
34
{-# LANGUAGE PatternSynonyms #-}
@@ -381,11 +382,14 @@ includePaths lbi bi clbi odir =
381382
allGhcOptExtra :: BuildInfo -> [String]
382383
allGhcOptExtra bi =
383384
["-optP" ++ opt | opt <- cppOptions bi]
384-
++ ["-optc" ++ opt | opt <- ccOptions bi]
385-
++ ["-optcxx" ++ opt | opt <- cxxOptions bi]
386385
++ ["-opta" ++ opt | opt <- asmOptions bi]
387-
++ ["-optl" ++ opt | opt <- ldOptions bi]
388386
++ ["-optJSP" ++ opt | opt <- jsppOptions bi]
387+
++ ["-optl" ++ opt | opt <- ldOptions bi]
388+
++ ["-optc" ++ opt | opt <- ccOptions bi]
389+
#if __GLASGOW_HASKELL__ >= 810
390+
-- Pass -optcxx for GHC >= 8.10 https://github.com/haskell/cabal/pull/7072
391+
++ ["-optcxx" ++ opt | opt <- cxxOptions bi]
392+
#endif
389393

390394
componentCcGhcOptions
391395
:: Verbosity

changelog.d/pr-10969.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
synopsis: Pass *-options to GHC when compiling ordinary Haskell sources
3-
packages: [Cabal, Cabal-syntax]
4-
prs: 10967
3+
packages: [Cabal]
4+
prs: 10969
55
---
66

77
*-options should be always passed when invoking GHC, similarly as ghc-options should be always used when invoking ghc - regardless of what is the intention of a particular GHC-call. GHC might use or not use the options, Cabal cannot know and should not guess.

0 commit comments

Comments
 (0)