File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Cabal/Distribution/Simple Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
-- |
2
2
-- This module defines a simple JSON-based format for exporting basic
3
3
-- information about a Cabal package and the compiler configuration Cabal
4
- -- would use to build it. This can be produced with the
4
+ -- would use to build it. This can be produced with the
5
5
-- @cabal new-show-build-info@ command.
6
- --
6
+ --
7
7
--
8
8
-- This format is intended for consumption by external tooling and should
9
9
-- therefore be rather stable. Moreover, this allows tooling users to avoid
@@ -97,7 +97,15 @@ mkBuildInfo pkg_descr lbi _flags targetsToBuild = info
97
97
]
98
98
where
99
99
path = maybe JsonNull (JsonString . programPath)
100
- $ lookupProgram ghcProgram (withPrograms lbi)
100
+ $ (flavorToProgram . compilerFlavor $ compiler lbi)
101
+ >>= flip lookupProgram (withPrograms lbi)
102
+
103
+ flavorToProgram :: CompilerFlavor -> Maybe Program
104
+ flavorToProgram GHC = Just ghcProgram
105
+ flavorToProgram GHCJS = Just ghcjsProgram
106
+ flavorToProgram UHC = Just uhcProgram
107
+ flavorToProgram JHC = Just jhcProgram
108
+ flavorToProgram _ = Nothing
101
109
102
110
mkComponentInfo (name, clbi) = JsonObject
103
111
[ " type" .= JsonString compType
You can’t perform that action at this time.
0 commit comments