shake-c 0.1.0.0 → 0.3.0.0
raw patch · 2 files changed
+8/−50 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Development.Shake.C: examineCC :: CCompiler -> Rules ()
- Development.Shake.C: examineCfg :: CConfig -> Rules ()
- Development.Shake.C: instance Control.DeepSeq.NFData Development.Shake.C.CC
- Development.Shake.C: instance Control.DeepSeq.NFData Development.Shake.C.CCompiler
- Development.Shake.C: instance Control.DeepSeq.NFData Development.Shake.C.CConfig
- Development.Shake.C: instance Control.DeepSeq.NFData Development.Shake.C.Cfg
- Development.Shake.C: instance Data.Binary.Class.Binary Development.Shake.C.CC
- Development.Shake.C: instance Data.Binary.Class.Binary Development.Shake.C.Cfg
- Development.Shake.C: instance Data.Hashable.Class.Hashable Development.Shake.C.CC
- Development.Shake.C: instance Data.Hashable.Class.Hashable Development.Shake.C.CCompiler
- Development.Shake.C: instance Data.Hashable.Class.Hashable Development.Shake.C.CConfig
- Development.Shake.C: instance Data.Hashable.Class.Hashable Development.Shake.C.Cfg
- Development.Shake.C: instance GHC.Classes.Eq Development.Shake.C.CC
- Development.Shake.C: instance GHC.Classes.Eq Development.Shake.C.CCompiler
- Development.Shake.C: instance GHC.Classes.Eq Development.Shake.C.CConfig
- Development.Shake.C: instance GHC.Classes.Eq Development.Shake.C.Cfg
- Development.Shake.C: instance GHC.Show.Show Development.Shake.C.CC
- Development.Shake.C: instance GHC.Show.Show Development.Shake.C.CCompiler
- Development.Shake.C: instance GHC.Show.Show Development.Shake.C.CConfig
- Development.Shake.C: instance GHC.Show.Show Development.Shake.C.Cfg
- Development.Shake.C: queryCC :: Action ()
- Development.Shake.C: queryCfg :: Action ()
+ Development.Shake.C: [_postfix] :: CCompiler -> Maybe String
+ Development.Shake.C: [_prefix] :: CCompiler -> Maybe String
Files
- shake-c.cabal +2/−3
- src/Development/Shake/C.hs +6/−47
shake-c.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: shake-c-version: 0.1.0.0+version: 0.3.0.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale@@ -30,8 +30,7 @@ Development.Shake.C hs-source-dirs: src default-language: Haskell2010- other-extensions: DeriveAnyClass DeriveGeneric DerivingStrategies- GeneralizedNewtypeDeriving PatternSynonyms TypeFamilies+ other-extensions: DeriveAnyClass DeriveGeneric ghc-options: -Wall build-depends: base >=4.3 && <5,
src/Development/Shake/C.hs view
@@ -1,15 +1,11 @@-{-# LANGUAGE DeriveAnyClass #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE DerivingStrategies #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE PatternSynonyms #-}-{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE DeriveGeneric #-} -- | This module provides functions for easy C builds of binaries, static -- libraries, and dynamic libraries. module Development.Shake.C ( -- * Types CConfig (..)- , CCompiler (ICC, GCC, Clang, GHC, Other, GCCStd, GHCStd, CompCert)+ , CCompiler (..) -- (ICC, GCC, Clang, GHC, Other, GCCStd, GHCStd, CompCert) -- * Rules , staticLibR , sharedLibR@@ -23,11 +19,6 @@ , staticLibA , sharedLibA , stripA- -- * Oracle helpers- , queryCC- , queryCfg- , examineCC- , examineCfg -- * Reëxports from "Language.C.Dependency" , getCDepends , getAll@@ -67,14 +58,6 @@ where withManufacturer "darwin" = "-apple-" ++ os withManufacturer _ = "-unknown-" ++ os --- | Default @gcc@ available-pattern GCCStd :: CCompiler-pattern GCCStd = GCC Nothing---- | Default @ghc@ available-pattern GHCStd :: CCompiler-pattern GHCStd = GHC Nothing Nothing- -- | Get the executable name for a 'CCompiler' ccToString :: CCompiler -> String ccToString ICC = "icc"@@ -125,7 +108,7 @@ | CompCert | ICC | Other String- deriving (Show, Eq, Generic, Typeable, Hashable, Binary, NFData)+ deriving (Generic, Binary) -- Show, Eq, Generic, Typeable, Hashable, Binary, NFData) mapFlags :: String -> ([String] -> [String]) mapFlags s = fmap (s ++)@@ -136,32 +119,7 @@ , extras :: [String] -- ^ Extra flags to be passed to the compiler , staticLink :: Bool -- ^ Whether to link against static versions of libraries }- deriving (Show, Eq, Generic, Typeable, Hashable, Binary, NFData)--newtype CC = CC ()- deriving (Show, Eq)- deriving newtype (Typeable, Hashable, Binary, NFData)--newtype Cfg = Cfg ()- deriving (Show, Eq)- deriving newtype (Typeable, Hashable, Binary, NFData)--type instance RuleResult CC = CCompiler-type instance RuleResult Cfg = CConfig---- | Set a 'CCompiler' that can be depended on later.-examineCC :: CCompiler -> Rules ()-examineCC cc = void $ addOracle $ \(CC _) -> pure cc--examineCfg :: CConfig -> Rules ()-examineCfg cfg = void $ addOracle $ \(Cfg _) -> pure cfg---- | Depend on the C compiler being used.-queryCC :: Action ()-queryCC = void $ askOracle (CC ())--queryCfg :: Action ()-queryCfg =void $ askOracle (Cfg ())+ deriving (Generic, Binary) -- Show, Eq, Generic, Typeable, Hashable, Binary, NFData) -- | Rules for making a static library from C source files. Unlike 'staticLibR', -- this also creates rules for creating object files.@@ -185,6 +143,7 @@ -> CConfig -> Rules () cBin cc sources bin cfg = bin %> \out -> binaryA cc sources out cfg+-- TODO depend on config!! stripA :: CmdResult r => FilePath -- ^ Build product to be stripped