Commit 71302254 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Use a better api for registering libs in the internal package db

parent 8c19815a
...@@ -71,8 +71,7 @@ import Distribution.PackageDescription ...@@ -71,8 +71,7 @@ import Distribution.PackageDescription
import qualified Distribution.ModuleName as ModuleName import qualified Distribution.ModuleName as ModuleName
import Distribution.Simple.Setup import Distribution.Simple.Setup
( BuildFlags(..), fromFlag, defaultRegisterFlags ( BuildFlags(..), fromFlag )
, RegisterFlags(..), Flag(..) )
import Distribution.Simple.PreProcess import Distribution.Simple.PreProcess
( preprocessSources, PPSuffixHandler ) ( preprocessSources, PPSuffixHandler )
import Distribution.Simple.LocalBuildInfo import Distribution.Simple.LocalBuildInfo
...@@ -80,7 +79,8 @@ import Distribution.Simple.LocalBuildInfo ...@@ -80,7 +79,8 @@ import Distribution.Simple.LocalBuildInfo
, ComponentLocalBuildInfo, withLibLBI, withExeLBI ) , ComponentLocalBuildInfo, withLibLBI, withExeLBI )
import Distribution.Simple.BuildPaths import Distribution.Simple.BuildPaths
( autogenModulesDir, autogenModuleName, cppHeaderName ) ( autogenModulesDir, autogenModuleName, cppHeaderName )
import Distribution.Simple.Register ( register ) import Distribution.Simple.Register
( registerPackage )
import Distribution.Simple.Utils import Distribution.Simple.Utils
( createDirectoryIfMissingVerbose, rewriteFile ( createDirectoryIfMissingVerbose, rewriteFile
, die, info, setupMessage ) , die, info, setupMessage )
...@@ -117,14 +117,10 @@ build pkg_descr lbi flags suffixes = do ...@@ -117,14 +117,10 @@ build pkg_descr lbi flags suffixes = do
info verbosity "Building library..." info verbosity "Building library..."
buildLib verbosity pkg_descr lbi lib clbi buildLib verbosity pkg_descr lbi lib clbi
-- Register library in-place, so exes can depend on internally defined libraries. -- Register the library in-place, so exes can depend
--TODO: go through a proper register api, not the generic command line action -- on internally defined libraries.
register pkg_descr lbi defaultRegisterFlags { registerPackage verbosity
regVerbosity = Flag verbosity, pkg_descr lib lbi clbi distPref True internalPackageDB
regPackageDB = Flag internalPackageDB,
regInPlace = Flag True,
regDistPref = Flag distPref
}
-- Use the internal package db for the exes. -- Use the internal package db for the exes.
let lbi' = lbi { withPackageDB = withPackageDB lbi ++ [internalPackageDB] } let lbi' = lbi { withPackageDB = withPackageDB lbi ++ [internalPackageDB] }
......
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