diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-11-04 04:29:04 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | f1a80658b08c8b489772052b5569cb1d3086db08 (patch) | |
tree | 32102f20750e8bd3b4ebb822f12bd4711d4fc602 /src/GlobalLib.cpp | |
parent | 31899d0a48108515d13508b660fb3bb82b869430 (diff) |
Store dependencies in different directories depending on target platform
This fixed conflicts in cache filepath when building 32-bit and 64-bit project on the same
machine or when doing cross compilation.
Diffstat (limited to 'src/GlobalLib.cpp')
-rw-r--r-- | src/GlobalLib.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/GlobalLib.cpp b/src/GlobalLib.cpp index 7f9d949..5c0e16d 100644 --- a/src/GlobalLib.cpp +++ b/src/GlobalLib.cpp @@ -102,7 +102,7 @@ namespace sibs // TODO: If return error is invalid url, then the message should be converted to // invalid package name/version. A check should be done if it is the name or version // that is invalid. - Result<bool> downloadDependencyResult = GlobalLib::downloadDependency(gitDependency); + Result<bool> downloadDependencyResult = GlobalLib::downloadDependency(gitDependency, parentConfig.platform); if(!downloadDependencyResult) return downloadDependencyResult; @@ -276,6 +276,8 @@ namespace sibs return Result<bool>::Err(libPathResult); FileString libPath = libPathResult.unwrap(); libPath += TINYDIR_STRING("/.cache/sibs/lib/"); + libPath += toFileString(asString(platform)); + libPath += TINYDIR_STRING("/"); libPath += toFileString(dependency->name); libPath += TINYDIR_STRING("/"); libPath += toFileString(package.version.toString()); @@ -308,13 +310,15 @@ namespace sibs return archiveExtractResult; } - Result<bool> GlobalLib::downloadDependency(GitDependency *dependency) + Result<bool> GlobalLib::downloadDependency(GitDependency *dependency, Platform platform) { Result<FileString> libPathResult = getHomeDir(); if (!libPathResult) return Result<bool>::Err(libPathResult); FileString libPath = libPathResult.unwrap(); libPath += TINYDIR_STRING("/.cache/sibs/lib/"); + libPath += toFileString(asString(platform)); + libPath += TINYDIR_STRING("/"); libPath += toFileString(dependency->name); // We dont care if the directory already exists. Nothing will happen if it does |