aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2017-12-02 14:51:45 +0100
committerDaniel Gröber <dxld@darkboxed.org>2018-01-18 14:10:26 +0100
commitc4a4fb609c813941f6ac45f2165a92ed85a214bc (patch)
treecf446da0c5b40e3b0fa16e02a6ffa65985e3fd3e
parent62251095adba9010ca063a119fb4bd6e1001bf60 (diff)
Fix componentOutDir for foreign-libs
-rw-r--r--src/CabalHelper/Runtime/Main.hs29
1 files changed, 16 insertions, 13 deletions
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 {..})