Add -f execonly to omit library/rts builds

This reduces the compile/test cycle time in development when there's no
effect on the libraries.
This commit is contained in:
Edwin Brady 2015-03-17 11:40:12 +00:00
parent e6d1cfdf9b
commit b4938580b2
2 changed files with 14 additions and 2 deletions

View File

@ -57,6 +57,13 @@ usesGMP flags =
Just False -> False
Nothing -> True
execOnly :: S.ConfigFlags -> Bool
execOnly flags =
case lookup (FlagName "execonly") (S.configConfigurationsFlags flags) of
Just True -> True
Just False -> False
Nothing -> True
isRelease :: S.ConfigFlags -> Bool
isRelease flags =
case lookup (FlagName "release") (S.configConfigurationsFlags flags) of
@ -176,7 +183,7 @@ getVersion args flags = do
let buildinfo = (emptyBuildInfo { cppOptions = ["-DVERSION="++hash] }) :: BuildInfo
return (Just buildinfo, [])
idrisBuild _ flags _ local = do
idrisBuild _ flags _ local = unless (execOnly (configFlags local)) $ do
buildStdLib
buildRTS
where
@ -199,7 +206,7 @@ idrisBuild _ flags _ local = do
-- -----------------------------------------------------------------------------
-- Copy/Install
idrisInstall verbosity copy pkg local = do
idrisInstall verbosity copy pkg local = unless (execOnly (configFlags local)) $ do
installStdLib
installRTS
where

View File

@ -658,6 +658,11 @@ Flag CI
Default: False
manual: True
Flag execonly
Description: Build executables only, skip the libraries and RTS
Default: False
manual: True
Library
hs-source-dirs: src
Exposed-modules: