diff --git a/Setup.hs b/Setup.hs index 6e9fe0729..28aea3095 100644 --- a/Setup.hs +++ b/Setup.hs @@ -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 diff --git a/idris.cabal b/idris.cabal index 215147d13..11ade9796 100644 --- a/idris.cabal +++ b/idris.cabal @@ -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: