Do not always add -Iincludes to C arguments (#610) upstream/master
authorAlp Mestanogullari <alpmestan@gmail.com>
Wed, 6 Jun 2018 20:26:13 +0000 (22:26 +0200)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Wed, 6 Jun 2018 20:26:13 +0000 (21:26 +0100)
src/Settings/Builders/Common.hs

index 1995c66..ae660db 100644 (file)
@@ -11,6 +11,7 @@ module Settings.Builders.Common (
 
 import Base
 import Expression
+import GHC.Packages
 import Hadrian.Haskell.Cabal.PackageData
 import Oracles.Flag
 import Oracles.Setting
@@ -27,7 +28,7 @@ cIncludeArgs = do
     iconvIncludeDir <- getSetting IconvIncludeDir
     gmpIncludeDir   <- getSetting GmpIncludeDir
     ffiIncludeDir   <- getSetting FfiIncludeDir
-    mconcat [ arg "-Iincludes"
+    mconcat [ notStage0 ||^ package compiler ? arg "-Iincludes"
             , arg $ "-I" ++ root -/- generatedDir
             , arg $ "-I" ++ path
             , pure . map ("-I"++) . filter (/= "") $ [iconvIncludeDir, gmpIncludeDir]