Commit fbc49628 authored by anton.dessiatov's avatar anton.dessiatov
Browse files

Helped extra-ghci-libraries find its way to .cabal files.

parent 040cf45d
......@@ -623,6 +623,7 @@ data BuildInfo = BuildInfo {
oldExtensions :: [Extension], -- ^ the old extensions field, treated same as 'defaultExtensions'
extraLibs :: [String], -- ^ what libraries to link with when compiling a program that uses your package
extraGHCiLibs :: [String], -- ^ if present, overrides extraLibs when package is loaded with GHCi.
extraLibDirs :: [String],
includeDirs :: [FilePath], -- ^directories to find .h files
includes :: [FilePath], -- ^ The .h files to be found in includeDirs
......@@ -655,6 +656,7 @@ instance Monoid BuildInfo where
otherExtensions = [],
oldExtensions = [],
extraLibs = [],
extraGHCiLibs = [],
extraLibDirs = [],
includeDirs = [],
includes = [],
......@@ -682,6 +684,7 @@ instance Monoid BuildInfo where
otherExtensions = combineNub otherExtensions,
oldExtensions = combineNub oldExtensions,
extraLibs = combine extraLibs,
extraGHCiLibs = combine extraGHCiLibs,
extraLibDirs = combineNub extraLibDirs,
includeDirs = combineNub includeDirs,
includes = combineNub includes,
......
......@@ -423,6 +423,9 @@ binfoFieldDescrs =
, listFieldWithSep vcat "extra-libraries"
showToken parseTokenQ
extraLibs (\xs binfo -> binfo{extraLibs=xs})
, listFieldWithSep vcat "extra-ghci-libraries"
showToken parseTokenQ
extraGHCiLibs (\xs binfo -> binfo{extraGHCiLibs=xs})
, listField "extra-lib-dirs"
showFilePath parseFilePathQ
extraLibDirs (\xs binfo -> binfo{extraLibDirs=xs})
......
......@@ -284,7 +284,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg lib clbi installDirs =
| LibraryName libname <- componentLibraries clbi
, hasLibrary ],
IPI.extraLibraries = extraLibs bi,
IPI.extraGHCiLibraries = [],
IPI.extraGHCiLibraries = extraGHCiLibs bi,
IPI.includeDirs = absinc ++ adjustRelIncDirs relinc,
IPI.includes = includes bi,
IPI.depends = map fst (componentPackageDeps clbi),
......
......@@ -1390,6 +1390,10 @@ values for these fields.
`extra-libraries:` _token list_
: A list of extra libraries to link with.
`extra-ghci-libraries:` _token list_
: A list of extra libraries to be used instead of 'extra-libraries' when
the package is loaded with GHCi.
`extra-lib-dirs:` _directory list_
: A list of directories to search for libraries.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment