Commit 7897a606 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Adjust registration to allow packages with no modules or objects

So ghc-pkg does not complain about missing files and dirs.
parent 7c51bcd8
......@@ -255,6 +255,9 @@ mkInstalledPackageInfo distPref pkg_descr lbi inplace = do
libraryDir
| inplace = build_dir
| otherwise = libdir installDirs
hasModules = not $ null (exposedModules lib)
&& null (otherModules bi)
hasLibrary = hasModules || not (null (cSources bi))
in
return InstalledPackageInfo {
IPI.package = packageId pkg_descr,
......@@ -270,9 +273,12 @@ mkInstalledPackageInfo distPref pkg_descr lbi inplace = do
IPI.exposed = libExposed lib,
IPI.exposedModules = exposedModules lib,
IPI.hiddenModules = otherModules bi,
IPI.importDirs = [libraryDir],
IPI.libraryDirs = libraryDir : extraLibDirs bi,
IPI.hsLibraries = ["HS" ++ display (packageId pkg_descr)],
IPI.importDirs = [ libraryDir | hasModules ],
IPI.libraryDirs = if hasLibrary
then libraryDir : extraLibDirs bi
else extraLibDirs bi,
IPI.hsLibraries = ["HS" ++ display (packageId pkg_descr)
| hasLibrary ],
IPI.extraLibraries = extraLibs bi,
IPI.extraGHCiLibraries= [],
IPI.includeDirs = absinc ++ if inplace
......
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