Commit 59bf880b authored by Edward Z. Yang's avatar Edward Z. Yang

Add optimization level to build directory structure.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent dd012e4a
......@@ -20,7 +20,7 @@ import System.FilePath
import Distribution.Package
( PackageId, UnitId(..) )
import Distribution.Compiler
import Distribution.Simple.Compiler (PackageDB(..))
import Distribution.Simple.Compiler (PackageDB(..), OptimisationLevel(..))
import Distribution.Text
import Distribution.Types.ComponentName
import Distribution.System
......@@ -37,7 +37,8 @@ data DistDirParams = DistDirParams {
distParamPackageId :: PackageId,
distParamComponentName :: Maybe ComponentName,
distParamCompilerId :: CompilerId,
distParamPlatform :: Platform
distParamPlatform :: Platform,
distParamOptimization :: OptimisationLevel
-- TODO (see #3343):
-- Flag assignments
-- Optimization
......@@ -123,6 +124,10 @@ defaultDistDirLayout projectRootDirectory =
Nothing -> ""
Just Nothing -> ""
Just (Just str) -> "c" </> str) </>
(case distParamOptimization params of
NoOptimisation -> "noopt"
NormalOptimisation -> ""
MaximumOptimisation -> "opt") </>
(case distParamUnitId params of -- For Backpack
SimpleUnitId _ -> "")
......
......@@ -287,7 +287,8 @@ elabDistDirParams shared elab = DistDirParams {
ElabComponent comp -> compComponentName comp
ElabPackage _ -> Nothing,
distParamCompilerId = compilerId (pkgConfigCompiler shared),
distParamPlatform = pkgConfigPlatform shared
distParamPlatform = pkgConfigPlatform shared,
distParamOptimization = elabOptimization elab
}
-- | The library dependencies (i.e., the libraries we depend on, NOT
......
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