aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Richardson <brichardson@structint.com>2020-05-03 19:53:18 -0700
committerBrad Richardson <brichardson@structint.com>2020-05-03 19:53:18 -0700
commitb4d6843c179ff4b5c78ff2a968998c7424f38792 (patch)
treed43e7f4a44343522ac2465345aa0348deb25396a /src
parent54f871cc0e9c63361e72068262f2458490a180ef (diff)
downloadfpm-b4d6843c179ff4b5c78ff2a968998c7424f38792.tar.gz
fpm-b4d6843c179ff4b5c78ff2a968998c7424f38792.zip
Add compiler as part of build path
Diffstat (limited to 'src')
-rw-r--r--src/Fpm.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Fpm.hs b/src/Fpm.hs
index c10f7b0..3fdf93e 100644
--- a/src/Fpm.hs
+++ b/src/Fpm.hs
@@ -224,16 +224,17 @@ executableCodec =
toml2AppSettings :: TomlSettings -> Bool -> IO AppSettings
toml2AppSettings tomlSettings release = do
let projectName = tomlSettingsProjectName tomlSettings
+ let compiler = "gfortran"
librarySettings <- getLibrarySettings $ tomlSettingsLibrary tomlSettings
executableSettings <- getExecutableSettings
(tomlSettingsExecutables tomlSettings)
projectName
testSettings <- getTestSettings $ tomlSettingsTests tomlSettings
+ buildPrefix <- makeBuildPrefix compiler release
return AppSettings
- { appSettingsCompiler = "gfortran"
+ { appSettingsCompiler = compiler
, appSettingsProjectName = projectName
- , appSettingsBuildPrefix = "build"
- </> if release then "release" else "debug"
+ , appSettingsBuildPrefix = buildPrefix
, appSettingsFlags = if release
then
[ "-Wall"
@@ -304,3 +305,9 @@ getTestSettings [] = do
else return []
else return []
getTestSettings tests = return tests
+
+makeBuildPrefix :: String -> Bool -> IO String
+makeBuildPrefix compiler release =
+ -- TODO Figure out what other info should be part of this
+ -- Probably version, and make sure to not include path to the compiler
+ return $ "build" </> compiler ++ "_" ++ if release then "release" else "debug"