Commit 2c7003a0 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Fix include paths for Gcc.

parent 79bc4c9d
......@@ -119,7 +119,7 @@ interestingInfo builder ss = case builder of
Ld -> prefixAndSuffix 4 0 ss
Gcc _ -> if head ss == "-MM"
then prefixAndSuffix 1 1 ss
else ss
else prefixAndSuffix 0 4 ss
Ghc _ -> if head ss == "-M"
then prefixAndSuffix 1 1 ss
else prefixAndSuffix 0 4 ss
......
......@@ -7,7 +7,8 @@ module Package.Base (
Package (..), Settings (..), TodoItem (..),
defaultSettings, libraryPackage, standardLibrary,
commonCcArgs, commonLdArgs, commonCppArgs, commonCcWarninigArgs,
pathArgs, packageArgs, includeGhcArgs, pkgHsSources,
pathArgs, packageArgs,
includeGccArgs, includeGhcArgs, pkgHsSources,
pkgDepHsObjects, pkgLibHsObjects, pkgCObjects,
argSizeLimit,
sourceDependecies,
......@@ -99,6 +100,12 @@ packageArgs stage pathDist = do
else productArgs "-package-name" (arg $ PackageKey pathDist)
<> productArgs "-package" (args $ Deps pathDist) ]
includeGccArgs :: FilePath -> FilePath -> Args
includeGccArgs path dist =
let pathDist = path </> dist
in args [ pathArgs "-I" path $ IncludeDirs pathDist
, pathArgs "-I" path $ DepIncludeDirs pathDist ]
includeGhcArgs :: FilePath -> FilePath -> Args
includeGhcArgs path dist =
let pathDist = path </> dist
......
......@@ -34,8 +34,7 @@ gccArgs (Package _ path _) (_, dist, _) srcs result =
in args [ args $ CcArgs pathDist
, commonCcArgs
, commonCcWarninigArgs
, pathArgs "-I" path $ IncludeDirs pathDist
, pathArgs "-I" path $ DepIncludeDirs pathDist
, includeGccArgs path dist
, args ("-c":srcs)
, args ["-o", result] ]
......
......@@ -51,7 +51,7 @@ gccArgs sourceFile (Package _ path _) (stage, dist, _) =
, args $ CcArgs pathDist
, commonCcArgs
, commonCcWarninigArgs
, pathArgs "-I" path $ IncludeDirs pathDist
, includeGccArgs path dist
, args ["-MF", unifyPath depFile]
, args ["-x", "c"]
, arg $ unifyPath sourceFile ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment