forked from GitHub/gf-rgl
Check GHC version instead of directory version
Explanation by Thomas Hallgren:
These MIN_VERSION macros are traditionally provided by Cabal, in dist/build/autogen/cabal_macros.h. It is only with ghc>=8.0 that ghc itself provides them, so with ghc<8, runghc Make.hs fails, as can be seen in the included message.
Incidentally, ghc-8.0.1 also comes with directory-1.3, so I suggest using
#if __GLASGOW_HASKELL__>=800
instead. Then Make.hs will work with older versions of ghc, and set the modification times if you are using ghc>=8.0.
This commit is contained in:
4
Make.hs
4
Make.hs
@@ -11,7 +11,7 @@ import System.Environment (getArgs,lookupEnv)
|
||||
import System.Process (rawSystem)
|
||||
import System.FilePath ((</>)) -- ,takeFileName,addExtension,dropExtension)
|
||||
import System.Directory (createDirectoryIfMissing,copyFile,getDirectoryContents,removeDirectoryRecursive,findFile)
|
||||
#if MIN_VERSION_directory(1,2,3)
|
||||
#if __GLASGOW_HASKELL__>=800
|
||||
import System.Directory (getModificationTime,setModificationTime)
|
||||
#endif
|
||||
import Control.Monad (when,unless)
|
||||
@@ -81,7 +81,7 @@ copyAll msg from to = do
|
||||
copyFileWithModificationTime :: FilePath -> FilePath -> IO ()
|
||||
copyFileWithModificationTime source destination = do
|
||||
copyFile source destination
|
||||
#if MIN_VERSION_directory(1,2,3)
|
||||
#if __GLASGOW_HASKELL__>=800
|
||||
getModificationTime source >>= setModificationTime destination
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user