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 ...@@ -119,7 +119,7 @@ interestingInfo builder ss = case builder of
Ld -> prefixAndSuffix 4 0 ss Ld -> prefixAndSuffix 4 0 ss
Gcc _ -> if head ss == "-MM" Gcc _ -> if head ss == "-MM"
then prefixAndSuffix 1 1 ss then prefixAndSuffix 1 1 ss
else ss else prefixAndSuffix 0 4 ss
Ghc _ -> if head ss == "-M" Ghc _ -> if head ss == "-M"
then prefixAndSuffix 1 1 ss then prefixAndSuffix 1 1 ss
else prefixAndSuffix 0 4 ss else prefixAndSuffix 0 4 ss
......
...@@ -7,7 +7,8 @@ module Package.Base ( ...@@ -7,7 +7,8 @@ module Package.Base (
Package (..), Settings (..), TodoItem (..), Package (..), Settings (..), TodoItem (..),
defaultSettings, libraryPackage, standardLibrary, defaultSettings, libraryPackage, standardLibrary,
commonCcArgs, commonLdArgs, commonCppArgs, commonCcWarninigArgs, commonCcArgs, commonLdArgs, commonCppArgs, commonCcWarninigArgs,
pathArgs, packageArgs, includeGhcArgs, pkgHsSources, pathArgs, packageArgs,
includeGccArgs, includeGhcArgs, pkgHsSources,
pkgDepHsObjects, pkgLibHsObjects, pkgCObjects, pkgDepHsObjects, pkgLibHsObjects, pkgCObjects,
argSizeLimit, argSizeLimit,
sourceDependecies, sourceDependecies,
...@@ -99,6 +100,12 @@ packageArgs stage pathDist = do ...@@ -99,6 +100,12 @@ packageArgs stage pathDist = do
else productArgs "-package-name" (arg $ PackageKey pathDist) else productArgs "-package-name" (arg $ PackageKey pathDist)
<> productArgs "-package" (args $ Deps 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 :: FilePath -> FilePath -> Args
includeGhcArgs path dist = includeGhcArgs path dist =
let pathDist = path </> dist let pathDist = path </> dist
......
...@@ -34,8 +34,7 @@ gccArgs (Package _ path _) (_, dist, _) srcs result = ...@@ -34,8 +34,7 @@ gccArgs (Package _ path _) (_, dist, _) srcs result =
in args [ args $ CcArgs pathDist in args [ args $ CcArgs pathDist
, commonCcArgs , commonCcArgs
, commonCcWarninigArgs , commonCcWarninigArgs
, pathArgs "-I" path $ IncludeDirs pathDist , includeGccArgs path dist
, pathArgs "-I" path $ DepIncludeDirs pathDist
, args ("-c":srcs) , args ("-c":srcs)
, args ["-o", result] ] , args ["-o", result] ]
......
...@@ -51,7 +51,7 @@ gccArgs sourceFile (Package _ path _) (stage, dist, _) = ...@@ -51,7 +51,7 @@ gccArgs sourceFile (Package _ path _) (stage, dist, _) =
, args $ CcArgs pathDist , args $ CcArgs pathDist
, commonCcArgs , commonCcArgs
, commonCcWarninigArgs , commonCcWarninigArgs
, pathArgs "-I" path $ IncludeDirs pathDist , includeGccArgs path dist
, args ["-MF", unifyPath depFile] , args ["-MF", unifyPath depFile]
, args ["-x", "c"] , args ["-x", "c"]
, arg $ unifyPath sourceFile ] , 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