From c4a4fb609c813941f6ac45f2165a92ed85a214bc Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sat, 2 Dec 2017 14:51:45 +0100 Subject: Fix componentOutDir for foreign-libs --- src/CabalHelper/Runtime/Main.hs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/CabalHelper/Runtime') diff --git a/src/CabalHelper/Runtime/Main.hs b/src/CabalHelper/Runtime/Main.hs index ab77bf6..28ee7a0 100644 --- a/src/CabalHelper/Runtime/Main.hs +++ b/src/CabalHelper/Runtime/Main.hs @@ -482,14 +482,6 @@ componentOptions (lbi, v, distdir) inplaceFlag flags f = gmModuleName :: C.ModuleName -> ChModuleName gmModuleName = ChModuleName . intercalate "." . components -exeOutDir :: LocalBuildInfo -> String -> FilePath -exeOutDir lbi exeName' = - ----- Copied from Distribution/Simple/GHC.hs:buildOrReplExe - let targetDir = (buildDir lbi) exeName' - exeDir = targetDir (exeName' ++ "-tmp") - in exeDir - - #if CH_MIN_VERSION_Cabal(2,0,0) removeInplaceDeps :: Verbosity -> LocalBuildInfo @@ -626,14 +618,25 @@ componentNameFromComponent (CExe Executable {..}) = CExeName exeName componentNameFromComponent (CTest TestSuite {..}) = CTestName testName componentNameFromComponent (CBench Benchmark {..}) = CBenchName benchmarkName -componentOutDir lbi (CLib Library {..})= buildDir lbi -componentOutDir lbi (CExe Executable {..})= exeOutDir lbi (unUnqualComponentName' exeName) +componentOutDir lbi (CLib Library {..})= + buildDir lbi +componentOutDir lbi (CFLib ForeignLib {..}) = + componentOutDir' lbi (unUnqualComponentName foreignLibName) +componentOutDir lbi (CExe Executable {..}) = + componentOutDir' lbi (unUnqualComponentName' exeName) componentOutDir lbi (CTest TestSuite { testInterface = TestSuiteExeV10 _ _, ..}) = - exeOutDir lbi (unUnqualComponentName' testName) + componentOutDir' lbi (unUnqualComponentName' testName) componentOutDir lbi (CTest TestSuite { testInterface = TestSuiteLibV09 _ _, ..}) = - exeOutDir lbi (unUnqualComponentName' testName ++ "Stub") + componentOutDir' lbi (unUnqualComponentName' testName ++ "Stub") componentOutDir lbi (CBench Benchmark { benchmarkInterface = BenchmarkExeV10 _ _, ..})= - exeOutDir lbi (unUnqualComponentName' benchmarkName) + componentOutDir' lbi (unUnqualComponentName' benchmarkName) + +componentOutDir' :: LocalBuildInfo -> String -> FilePath +componentOutDir' lbi compName' = + ----- Copied from Distribution/Simple/GHC.hs:buildOrReplExe + let targetDir = (buildDir lbi) compName' + compDir = targetDir (compName' ++ "-tmp") + in compDir componentEntrypoints :: Component -> ChEntrypoint componentEntrypoints (CLib Library {..}) -- cgit v1.2.3