build: ship clang compiler header within Sourcetrail package on macOS and Linux

* replace path to local compiler headers with packaged ones in include path detection
* added app settings migration to replace local compiler header path with path to packaged headers
This commit is contained in:
Eberhard Graether
2018-06-18 14:08:50 +02:00
parent a1c146d439
commit f11be042a6
20 changed files with 121 additions and 22 deletions
+15 -4
View File
@@ -9,10 +9,11 @@
#include "utility/Status.h"
#include "utility/TimeStamp.h"
#include "utility/utility.h"
#include "utility/utilityCxx.h"
#include "utility/UserPaths.h"
#include "utility/Version.h"
const size_t ApplicationSettings::VERSION = 4;
const size_t ApplicationSettings::VERSION = 5;
std::shared_ptr<ApplicationSettings> ApplicationSettings::s_instance;
@@ -34,9 +35,9 @@ ApplicationSettings::~ApplicationSettings()
{
}
bool ApplicationSettings::load(const FilePath& filePath)
bool ApplicationSettings::load(const FilePath& filePath, bool readOnly)
{
bool loaded = Settings::load(filePath);
bool loaded = Settings::load(filePath, readOnly);
if (!loaded)
{
return false;
@@ -85,9 +86,19 @@ bool ApplicationSettings::load(const FilePath& filePath)
}
}
));
migrator.addMigration(5, std::make_shared<SettingsMigrationLambda>(
[](const SettingsMigration* migration, Settings* settings)
{
std::vector<FilePath> cxxHeaderSearchPaths = migration->getValuesFromSettings(
settings, "indexing/cxx/header_search_paths/header_search_path", std::vector<FilePath>());
cxxHeaderSearchPaths = utility::replaceOrAddCxxCompilerHeaderPath(cxxHeaderSearchPaths);
migration->setValuesInSettings(settings, "indexing/cxx/header_search_paths/header_search_path", cxxHeaderSearchPaths);
}
));
bool migrated = migrator.migrate(this, ApplicationSettings::VERSION);
if (migrated)
{
save();