aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMilan Curcic <caomaco@gmail.com>2020-05-04 08:35:17 -0400
committerGitHub <noreply@github.com>2020-05-04 08:35:17 -0400
commit82d1465554676b8d0ae2137a3e044402bdf3d869 (patch)
tree626eaa6b9337c2736ef1fc7bc0d7aa036aebbf91 /src
parent736b2a7f29b57217af282dfc7fb316d5091a306d (diff)
parentb4d6843c179ff4b5c78ff2a968998c7424f38792 (diff)
downloadfpm-82d1465554676b8d0ae2137a3e044402bdf3d869.tar.gz
fpm-82d1465554676b8d0ae2137a3e044402bdf3d869.zip
Merge pull request #74 from everythingfunctional/AddCompilerToBuildPath
Add compiler to 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 0bc909d..3f06c05 100644
--- a/src/Fpm.hs
+++ b/src/Fpm.hs
@@ -228,16 +228,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"
@@ -308,3 +309,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"