Skip to content

Commit

Permalink
Support llvm-config executables named llvm-config-7
Browse files Browse the repository at this point in the history
  • Loading branch information
cocreature committed Sep 29, 2018
1 parent 8bb3ef0 commit d85be6b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions llvm-hs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 7.0.1 (2018-09-29)

* Support llvm-config executables named `llvm-config-7` in addition to
`llvm-config-7.0` and `llvm-config`.

## 7.0.0 (2018-09-28)

* Throw an `EncodeException` if a local variable is defined multiple
Expand Down
12 changes: 8 additions & 4 deletions llvm-hs/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ lookupFlagAssignment = lookup
llvmVersion :: Version
llvmVersion = mkVersion [7,0]

-- Ordered by decreasing specificty so we will prefer llvm-config-7.0
-- over llvm-config-7 over llvm-config.
llvmConfigNames :: [String]
llvmConfigNames = [
"llvm-config-" ++ (intercalate "." . map show . versionNumbers $ llvmVersion),
"llvm-config"
]
llvmConfigNames = reverse versionedConfigs ++ ["llvm-config"]
where
versionedConfigs =
map
(\vs -> "llvm-config-" ++ intercalate "." (map show vs))
(tail (inits (versionNumbers llvmVersion)))

findJustBy :: Monad m => (a -> m (Maybe b)) -> [a] -> m (Maybe b)
findJustBy f (x:xs) = do
Expand Down
2 changes: 1 addition & 1 deletion llvm-hs/llvm-hs.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: llvm-hs
version: 7.0.0
version: 7.0.1
license: BSD3
license-file: LICENSE
author: Anthony Cowley, Stephen Diehl, Moritz Kiefer <[email protected]>, Benjamin S. Scarlet
Expand Down

0 comments on commit d85be6b

Please sign in to comment.