Commit 5d2cf2c3 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add toStandard to varios places.

parent 821776b9
......@@ -84,7 +84,8 @@ bootPkgConstraints = mempty
-- sed "s/[^0-9.]//g")"))
pathArgs :: ShowArgs a => String -> FilePath -> a -> Args
pathArgs key path as = map (\a -> key ++ normaliseEx (path </> a)) <$> arg as
pathArgs key path as =
map (\a -> key ++ toStandard (normaliseEx $ path </> a)) <$> arg as
packageArgs :: Stage -> FilePath -> Args
packageArgs stage pkgData = do
......@@ -100,14 +101,14 @@ packageArgs stage pkgData = do
includeArgs :: FilePath -> FilePath -> Args
includeArgs path dist =
let pkgData = path </> dist </> "package-data.mk"
buildDir = path </> dist </> "build"
let pkgData = toStandard $ path </> dist </> "package-data.mk"
buildDir = toStandard $ path </> dist </> "build"
in arg "-i"
<> pathArgs "-i" path (SrcDirs pkgData)
<> concatArgs ["-i", "-I"] [buildDir, buildDir </> "autogen"]
<> concatArgs ["-i", "-I"] [buildDir, toStandard $ buildDir </> "autogen"]
<> pathArgs "-I" path (IncludeDirs pkgData)
<> arg "-optP-include" -- TODO: Shall we also add -cpp?
<> concatArgs "-optP" (buildDir </> "autogen/cabal_macros.h")
<> concatArgs "-optP" (toStandard $ buildDir </> "autogen/cabal_macros.h")
pkgHsSources :: FilePath -> FilePath -> Action [FilePath]
pkgHsSources path dist = do
......
......@@ -5,16 +5,16 @@ import Package.Base
buildPackageDependencies :: Package -> TodoItem -> Rules ()
buildPackageDependencies (Package name path _) (stage, dist, settings) =
let buildDir = path </> dist </> "build"
pkgData = path </> dist </> "package-data.mk"
let buildDir = toStandard $ path </> dist </> "build"
pkgData = toStandard $ path </> dist </> "package-data.mk"
in
(buildDir </> name <.> "m") %> \out -> do
need ["shake/src/Package/Dependencies.hs"]
terseRun (Ghc stage) $ arg "-M"
<> packageArgs stage pkgData
<> includeArgs path dist
<> productArgs ["-odir", "-stubdir"] buildDir
<> arg ["-dep-makefile", out <.> "new"]
<> productArgs ["-odir", "-stubdir", "-hidir"] buildDir
<> arg ["-dep-makefile", toStandard $ out <.> "new"]
<> productArgs "-dep-suffix" (map wayPrefix <$> ways settings)
<> arg (pkgHsSources path dist)
-- TODO: Check that skipping all _HC_OPTS is safe.
......
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