@@ -62,6 +62,8 @@ import Distribution.Simple.BuildPaths
62
62
import Distribution.Simple.Compiler
63
63
import Distribution.Simple.Errors
64
64
import Distribution.Simple.Flag
65
+ import Distribution.Simple.GHC.Build.Link (hasThreaded )
66
+ import Distribution.Simple.GHC.Build.Utils (isCxx , isHaskell )
65
67
import Distribution.Simple.GHC.EnvironmentParser
66
68
import Distribution.Simple.GHC.ImplInfo
67
69
import qualified Distribution.Simple.GHC.Internal as Internal
@@ -1242,13 +1244,6 @@ gbuildSources verbosity mbWorkDir pkgId specVer tmpDir bm =
1242
1244
, inputSourceModules = foreignLibModules flib
1243
1245
}
1244
1246
1245
- isCxx :: FilePath -> Bool
1246
- isCxx fp = elem (takeExtension fp) [" .cpp" , " .cxx" , " .c++" ]
1247
-
1248
- -- | FilePath has a Haskell extension: .hs or .lhs
1249
- isHaskell :: FilePath -> Bool
1250
- isHaskell fp = elem (takeExtension fp) [" .hs" , " .lhs" ]
1251
-
1252
1247
-- | Generic build function. See comment for 'GBuildMode'.
1253
1248
gbuild
1254
1249
:: Verbosity
@@ -1776,7 +1771,7 @@ getRPaths _ _ = return mempty
1776
1771
popThreadedFlag :: BuildInfo -> (BuildInfo , Bool )
1777
1772
popThreadedFlag bi =
1778
1773
( bi{options = filterHcOptions (/= " -threaded" ) (options bi)}
1779
- , hasThreaded (options bi)
1774
+ , hasThreaded bi
1780
1775
)
1781
1776
where
1782
1777
filterHcOptions
@@ -1786,9 +1781,6 @@ popThreadedFlag bi =
1786
1781
filterHcOptions p (PerCompilerFlavor ghc ghcjs) =
1787
1782
PerCompilerFlavor (filter p ghc) ghcjs
1788
1783
1789
- hasThreaded :: PerCompilerFlavor [String ] -> Bool
1790
- hasThreaded (PerCompilerFlavor ghc _) = elem " -threaded" ghc
1791
-
1792
1784
-- | Extracts a String representing a hash of the ABI of a built
1793
1785
-- library. It can fail if the library has not yet been built.
1794
1786
libAbiHash
0 commit comments