diff options
author | Brad Richardson <brichardson@structint.com> | 2020-03-03 19:59:19 -0800 |
---|---|---|
committer | Brad Richardson <brichardson@structint.com> | 2020-03-03 19:59:19 -0800 |
commit | a145a9fc1e7dffbacbb7151fa543267a86e90cde (patch) | |
tree | c035acf8a4d71e9201dc7394a43bc0dcef28ac83 /src | |
parent | 92923f59d36726a99f9bb8435805a41ac5ba1388 (diff) | |
download | fpm-a145a9fc1e7dffbacbb7151fa543267a86e90cde.tar.gz fpm-a145a9fc1e7dffbacbb7151fa543267a86e90cde.zip |
Fix building executables on windows
Diffstat (limited to 'src')
-rw-r--r-- | src/Build.hs | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/Build.hs b/src/Build.hs index d4432bb..2febb87 100644 --- a/src/Build.hs +++ b/src/Build.hs @@ -88,11 +88,11 @@ buildPrograms programDirectory libraryDirectories sourceExtensions buildDirector } $ do buildDirectory </> "*" <.> "o" %> \objectFile -> do - let realObjectFile = foldl (</>) "" $ splitDirectories objectFile + let realObjectFile = + foldl (</>) "" $ splitDirectories objectFile let sourceFile = fromMaybe undefined - (Map.lookup realObjectFile sourceFileLookupMap - ) + (Map.lookup realObjectFile sourceFileLookupMap) need [sourceFile] modulesUsed <- liftIO $ getModulesUsed sourceFile let @@ -105,11 +105,14 @@ buildPrograms programDirectory libraryDirectories sourceExtensions buildDirector includeFlags flags ["-o", objectFile, sourceFile] - (`elem` executables) ?> \exe -> do - let objectFile = map toLower exe -<.> "o" - need [objectFile] - need archives - cmd compiler objectFile archives ["-o", exe] flags + (\file -> + foldl (</>) "" (splitDirectories file) `elem` executables + ) + ?> \exe -> do + let objectFile = map toLower exe -<.> "o" + need [objectFile] + need archives + cmd compiler objectFile archives ["-o", exe] flags want executables buildLibrary @@ -140,10 +143,13 @@ buildLibrary libraryDirectory sourceExtensions buildDirectory compiler flags lib $ do map (\ext -> buildDirectory </> "*" <.> ext) ["o", "mod"] &%> \[objectFile, moduleFile] -> do - let realObjectFile = foldl (</>) "" $ splitDirectories objectFile + let + realObjectFile = foldl (</>) "" + $ splitDirectories objectFile let sourceFile = fromMaybe undefined - (Map.lookup realObjectFile sourceFileLookupMap + (Map.lookup realObjectFile + sourceFileLookupMap ) need [sourceFile] modulesUsed <- liftIO $ getModulesUsed sourceFile |