From a4d9019b480ad59c3a496f83bc307bc299d6d9eb Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Fri, 8 Dec 2017 16:46:25 +0200 Subject: Add CPP for earlier cabal versions --- src/CabalHelper/Runtime/Main.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/CabalHelper') diff --git a/src/CabalHelper/Runtime/Main.hs b/src/CabalHelper/Runtime/Main.hs index e6d7a22..6e013a1 100644 --- a/src/CabalHelper/Runtime/Main.hs +++ b/src/CabalHelper/Runtime/Main.hs @@ -377,10 +377,15 @@ main = do return $ Just $ ChResponsePkgDbs $ map pkgDb $ withPackageDB lbi "entrypoints":[] -> do +#if CH_MIN_VERSION_Cabal(2,0,0) includeDirMap <- recursiveDepInfo lbi v distdir eps <- componentsMap lbi v distdir $ \c clbi _bi -> do let (_,_,seps) = recursiveIncludeDirs includeDirMap (componentUnitId clbi) return seps +#else + eps <- componentsMap lbi v distdir $ \c _clbi _bi -> + return $ componentEntrypoints c +#endif -- MUST append Setup component at the end otherwise CabalHelper gets -- confused let eps' = eps ++ [(ChSetupHsName, ChSetupEntrypoint)] @@ -459,7 +464,9 @@ componentsMap lbi _v _distdir f = do componentOptions' (lbi, v, distdir) inplaceFlag flags rf f = do let pd = localPkgDescr lbi +#if CH_MIN_VERSION_Cabal(2,0,0) includeDirMap <- recursiveDepInfo lbi v distdir +#endif componentsMap lbi v distdir $ \c clbi bi -> let -- cgit v1.2.3