module HIE.Bios.Flags (getCompilerOptions) where
import HIE.Bios.Types
import Colog.Core (WithSeverity (..), Severity (..), (<&))
getCompilerOptions
:: FilePath
-> [FilePath]
-> Cradle a
-> IO (CradleLoadResult ComponentOptions)
getCompilerOptions :: forall a.
FilePath
-> [FilePath] -> Cradle a -> IO (CradleLoadResult ComponentOptions)
getCompilerOptions FilePath
fp [FilePath]
fps Cradle a
cradle = do
(forall a. Cradle a -> LogAction IO (WithSeverity Log)
cradleLogger Cradle a
cradle) forall (m :: * -> *) msg. LogAction m msg -> msg -> m ()
<& FilePath -> Log
LogProcessOutput FilePath
"invoking build tool to determine build flags (this may take some time depending on the cache)" forall msg. msg -> Severity -> WithSeverity msg
`WithSeverity` Severity
Info
forall a.
CradleAction a
-> FilePath -> [FilePath] -> IO (CradleLoadResult ComponentOptions)
runCradle (forall a. Cradle a -> CradleAction a
cradleOptsProg Cradle a
cradle) FilePath
fp [FilePath]
fps