shake-language-c 0.8.4 → 0.8.6
raw patch · 4 files changed
+22/−10 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- README.md +3/−1
- shake-language-c.cabal +1/−1
- src/Development/Shake/Language/C/Host/Windows.hs +13/−8
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog for shake-language-c +## v0.8.6++* Fix Windows host target+* Get host architecture from environment on Windows+ ## v0.8.3 * Allow to set linker command via `LD` environment variable
README.md view
@@ -1,7 +1,9 @@ # shake-language-c [](https://hackage.haskell.org/package/shake-language-c)-[](https://travis-ci.org/samplecount/shake-language-c)+[](http://stackage.org/lts/package/shake-language-c)+[](http://stackage.org/nightly/package/shake-language-c)+[](https://travis-ci.org/samplecount/shake-language-c) **shake-language-c** is a cross-platform build system based on the [Shake](https://github.com/ndmitchell/shake) Haskell library. The focus is on cross-compilation of *C*, *C++* and *Objective C* source code to various target platforms. Currently supported target platforms are *iOS*, *Android NDK*, *Google Portable Native Client*, *MacOS X*, *Linux* and *Windows* (*MinGW*). Supported host platforms are *MacOS X*, *Linux* and *Windows*.
shake-language-c.cabal view
@@ -13,7 +13,7 @@ -- limitations under the License. Name: shake-language-c-Version: 0.8.4+Version: 0.8.6 Synopsis: Utilities for cross-compiling with Shake Description: This library provides <http://hackage.haskell.org/package/shake Shake> utilities for cross-compiling @C@, @C++@ and @ObjC@ code for various target platforms. Currently supported target platforms are Android, iOS, Linux, MacOS X, Windows\/MinGW and Google Portable Native Client (PNaCl). Supported host platforms are MacOS X, Linux and Windows. Category: Development
src/Development/Shake/Language/C/Host/Windows.hs view
@@ -16,21 +16,26 @@ getHostToolChain ) where +import Data.Char (isSpace) import Development.Shake+import Development.Shake.Command import Development.Shake.Language.C.Target-import Development.Shake.Language.C.Target.Linux+import Development.Shake.Language.C.Target.Windows import Development.Shake.Language.C.ToolChain import qualified System.Info as System +trim :: String -> String+trim = reverse . dropWhile isSpace . reverse+ getHostArch :: IO Arch getHostArch = do- -- TODO: Get the info from the environment- let arch = System.arch- return $ case arch of- "i386" -> X86 I386- "i686" -> X86 I686- "x86_64" -> X86 X86_64- _ -> error $ "Unknown host architecture " ++ arch+ Stdout out <- cmd "wmic os get osarchitecture"+ let spec = map trim . lines $ out+ case spec of+ ("OSArchitecture":"32-Bit":_) -> return $ X86 I686+ ("OSArchitecture":"64-Bit":_) -> return $ X86 X86_64+ ("OSArchitecture":arch:_) -> error $ "Unknown host architecture " ++ arch+ _ -> error $ "Couldn't determine host architecture from " ++ show spec getHostToolChain :: IO (Target, Action ToolChain) getHostToolChain = do