{- -----------------------------------------------------------------------------
Copyright 2020-2021 Kevin P. Barry

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
----------------------------------------------------------------------------- -}

-- Author: Kevin P. Barry [ta0kira@gmail.com]

{-# LANGUAGE Safe #-}

module Config.CompilerConfig (
  Backend(..),
  LocalConfig(..),
  Resolver(..),
) where


data LocalConfig =
  LocalConfig {
    LocalConfig -> Resolver
lcResolver :: Resolver,
    LocalConfig -> Backend
lcBackend :: Backend
  }
  deriving (LocalConfig -> LocalConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocalConfig -> LocalConfig -> Bool
$c/= :: LocalConfig -> LocalConfig -> Bool
== :: LocalConfig -> LocalConfig -> Bool
$c== :: LocalConfig -> LocalConfig -> Bool
Eq,Int -> LocalConfig -> ShowS
[LocalConfig] -> ShowS
LocalConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocalConfig] -> ShowS
$cshowList :: [LocalConfig] -> ShowS
show :: LocalConfig -> String
$cshow :: LocalConfig -> String
showsPrec :: Int -> LocalConfig -> ShowS
$cshowsPrec :: Int -> LocalConfig -> ShowS
Show)

data Backend =
  UnixBackend {
    Backend -> String
ucCxxBinary :: FilePath,
    Backend -> [String]
ucCompileFlags :: [String],
    Backend -> [String]
ucLibraryFlags :: [String],
    Backend -> [String]
ucBinaryFlags :: [String],
    Backend -> String
ucArBinary :: FilePath
  }
  deriving (Backend -> Backend -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Backend -> Backend -> Bool
$c/= :: Backend -> Backend -> Bool
== :: Backend -> Backend -> Bool
$c== :: Backend -> Backend -> Bool
Eq,Int -> Backend -> ShowS
[Backend] -> ShowS
Backend -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Backend] -> ShowS
$cshowList :: [Backend] -> ShowS
show :: Backend -> String
$cshow :: Backend -> String
showsPrec :: Int -> Backend -> ShowS
$cshowsPrec :: Int -> Backend -> ShowS
Show)

data Resolver =
  SimpleResolver {
    Resolver -> [String]
srVisibleSystem :: [FilePath],
    Resolver -> [String]
srExtraPaths :: [FilePath]
  }
  deriving (Resolver -> Resolver -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Resolver -> Resolver -> Bool
$c/= :: Resolver -> Resolver -> Bool
== :: Resolver -> Resolver -> Bool
$c== :: Resolver -> Resolver -> Bool
Eq,Int -> Resolver -> ShowS
[Resolver] -> ShowS
Resolver -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Resolver] -> ShowS
$cshowList :: [Resolver] -> ShowS
show :: Resolver -> String
$cshow :: Resolver -> String
showsPrec :: Int -> Resolver -> ShowS
$cshowsPrec :: Int -> Resolver -> ShowS
Show)