aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/src/BuildModel.hs
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 11:27:30 -0500
committerBrad Richardson <everythingfunctional@protonmail.com>2020-10-20 11:27:30 -0500
commit5db397ddca9ffa5558fb80ebfad73332f8c52cd6 (patch)
treea3a275c6062e4949d6fa29328d0e1569ca1a47c9 /bootstrap/src/BuildModel.hs
parent20ee2333cd86909e21ca5bd88f3d7166e1941c92 (diff)
downloadfpm-5db397ddca9ffa5558fb80ebfad73332f8c52cd6.tar.gz
fpm-5db397ddca9ffa5558fb80ebfad73332f8c52cd6.zip
Add test for program's direct dependencies
Diffstat (limited to 'bootstrap/src/BuildModel.hs')
-rw-r--r--bootstrap/src/BuildModel.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs
index 86df719..f4c809f 100644
--- a/bootstrap/src/BuildModel.hs
+++ b/bootstrap/src/BuildModel.hs
@@ -62,6 +62,7 @@ data CompileTimeInfo = CompileTimeInfo {
compileTimeInfoSourceFileName :: FilePath
, compileTimeInfoObjectFileProduced :: FilePath
, compileTimeInfoOtherFilesProduced :: [FilePath]
+ , compileTimeInfoDirectDependencies :: [FilePath]
}
processRawSource :: RawSource -> Source
@@ -92,13 +93,16 @@ processRawSource rawSource =
}
else undefined
-constructCompileTimeInfo :: Source -> [Source] -> FilePath -> CompileTimeInfo
-constructCompileTimeInfo program@(Program{}) otherSources buildDirectory =
+constructCompileTimeInfo :: Source -> [String] -> FilePath -> CompileTimeInfo
+constructCompileTimeInfo program@(Program{}) availableModules buildDirectory =
CompileTimeInfo
{ compileTimeInfoSourceFileName = programSourceFileName program
, compileTimeInfoObjectFileProduced = (programObjectFileName program)
buildDirectory
, compileTimeInfoOtherFilesProduced = []
+ , compileTimeInfoDirectDependencies = map
+ (\mName -> buildDirectory </> mName <.> "mod")
+ (filter (`elem` availableModules) (programModulesUsed program))
}
constructCompileTimeInfo _ otherSources buildDirectory = undefined