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 { ...@@ -623,6 +623,7 @@ data BuildInfo = BuildInfo {
oldExtensions :: [Extension], -- ^ the old extensions field, treated same as 'defaultExtensions' 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 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], extraLibDirs :: [String],
includeDirs :: [FilePath], -- ^directories to find .h files includeDirs :: [FilePath], -- ^directories to find .h files
includes :: [FilePath], -- ^ The .h files to be found in includeDirs includes :: [FilePath], -- ^ The .h files to be found in includeDirs
...@@ -655,6 +656,7 @@ instance Monoid BuildInfo where ...@@ -655,6 +656,7 @@ instance Monoid BuildInfo where
otherExtensions = [], otherExtensions = [],
oldExtensions = [], oldExtensions = [],
extraLibs = [], extraLibs = [],
extraGHCiLibs = [],
extraLibDirs = [], extraLibDirs = [],
includeDirs = [], includeDirs = [],
includes = [], includes = [],
...@@ -682,6 +684,7 @@ instance Monoid BuildInfo where ...@@ -682,6 +684,7 @@ instance Monoid BuildInfo where
otherExtensions = combineNub otherExtensions, otherExtensions = combineNub otherExtensions,
oldExtensions = combineNub oldExtensions, oldExtensions = combineNub oldExtensions,
extraLibs = combine extraLibs, extraLibs = combine extraLibs,
extraGHCiLibs = combine extraGHCiLibs,
extraLibDirs = combineNub extraLibDirs, extraLibDirs = combineNub extraLibDirs,
includeDirs = combineNub includeDirs, includeDirs = combineNub includeDirs,
includes = combineNub includes, includes = combineNub includes,
......
...@@ -423,6 +423,9 @@ binfoFieldDescrs = ...@@ -423,6 +423,9 @@ binfoFieldDescrs =
, listFieldWithSep vcat "extra-libraries" , listFieldWithSep vcat "extra-libraries"
showToken parseTokenQ showToken parseTokenQ
extraLibs (\xs binfo -> binfo{extraLibs=xs}) extraLibs (\xs binfo -> binfo{extraLibs=xs})
, listFieldWithSep vcat "extra-ghci-libraries"
showToken parseTokenQ
extraGHCiLibs (\xs binfo -> binfo{extraGHCiLibs=xs})
, listField "extra-lib-dirs" , listField "extra-lib-dirs"
showFilePath parseFilePathQ showFilePath parseFilePathQ
extraLibDirs (\xs binfo -> binfo{extraLibDirs=xs}) extraLibDirs (\xs binfo -> binfo{extraLibDirs=xs})
......
...@@ -284,7 +284,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg lib clbi installDirs = ...@@ -284,7 +284,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg lib clbi installDirs =
| LibraryName libname <- componentLibraries clbi | LibraryName libname <- componentLibraries clbi
, hasLibrary ], , hasLibrary ],
IPI.extraLibraries = extraLibs bi, IPI.extraLibraries = extraLibs bi,
IPI.extraGHCiLibraries = [], IPI.extraGHCiLibraries = extraGHCiLibs bi,
IPI.includeDirs = absinc ++ adjustRelIncDirs relinc, IPI.includeDirs = absinc ++ adjustRelIncDirs relinc,
IPI.includes = includes bi, IPI.includes = includes bi,
IPI.depends = map fst (componentPackageDeps clbi), IPI.depends = map fst (componentPackageDeps clbi),
......
...@@ -1390,6 +1390,10 @@ values for these fields. ...@@ -1390,6 +1390,10 @@ values for these fields.
`extra-libraries:` _token list_ `extra-libraries:` _token list_
: A list of extra libraries to link with. : 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_ `extra-lib-dirs:` _directory list_
: A list of directories to search for libraries. : A list of directories to search for libraries.
......
Supports Markdown
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