logic: cleaned up code for SourceGroupSettings and Wizzard

* Flattened sourcegroupsettings class hierarchy by moving cross compilation options to own base class
* QtProjectWizzardContentFlags constructor required correct settings object to reduce the need for type casting
* QtProjectWizzardContentPath constructors required correct settings objects
* moved SourcePaths from SourceGroupSettingsJava to SourceGroupSettingsJavaEmpty because they are not required for Gradle and Maven projects
* removed classpath from maven and gradle source group settings
* reuse code of SourceGroup for "show source files" in wizard
This commit is contained in:
mlangkabel
2018-06-12 21:16:51 +02:00
parent dca4c3c16b
commit c65a5d04b1
34 changed files with 697 additions and 570 deletions
+17 -5
View File
@@ -1,26 +1,34 @@
#include "settings/SourceGroupSettingsCEmpty.h"
SourceGroupSettingsCEmpty::SourceGroupSettingsCEmpty(const std::string& id, const ProjectSettings* projectSettings)
: SourceGroupSettingsCxxEmpty(id, SOURCE_GROUP_C_EMPTY, projectSettings)
: SourceGroupSettingsCxx(id, SOURCE_GROUP_C_EMPTY, projectSettings)
{
}
void SourceGroupSettingsCEmpty::load(std::shared_ptr<const ConfigManager> config)
{
SourceGroupSettingsCxxEmpty::load(config);
SourceGroupSettingsCxx::load(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithCStandard::load(config, key);
SourceGroupSettingsWithCxxCrossCompilationOptions::load(config, key);
SourceGroupSettingsWithSourceExtensions::load(config, key);
SourceGroupSettingsWithSourcePaths::load(config, key);
SourceGroupSettingsWithExcludeFilters::load(config, key);
}
void SourceGroupSettingsCEmpty::save(std::shared_ptr<ConfigManager> config)
{
SourceGroupSettingsCxxEmpty::save(config);
SourceGroupSettingsCxx::save(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithCStandard::save(config, key);
SourceGroupSettingsWithCxxCrossCompilationOptions::save(config, key);
SourceGroupSettingsWithSourceExtensions::save(config, key);
SourceGroupSettingsWithSourcePaths::save(config, key);
SourceGroupSettingsWithExcludeFilters::save(config, key);
}
bool SourceGroupSettingsCEmpty::equals(std::shared_ptr<SourceGroupSettings> other) const
@@ -29,8 +37,12 @@ bool SourceGroupSettingsCEmpty::equals(std::shared_ptr<SourceGroupSettings> othe
return (
otherCxxEmpty &&
SourceGroupSettingsCxxEmpty::equals(other) &&
SourceGroupSettingsWithCStandard::equals(otherCxxEmpty)
SourceGroupSettingsCxx::equals(other) &&
SourceGroupSettingsWithCStandard::equals(otherCxxEmpty) &&
SourceGroupSettingsWithCxxCrossCompilationOptions::equals(otherCxxEmpty) &&
SourceGroupSettingsWithSourceExtensions::equals(otherCxxEmpty) &&
SourceGroupSettingsWithSourcePaths::equals(otherCxxEmpty) &&
SourceGroupSettingsWithExcludeFilters::equals(otherCxxEmpty)
);
}
+10 -2
View File
@@ -1,12 +1,20 @@
#ifndef SOURCE_GROUP_SETTINGS_C_EMPTY_H
#define SOURCE_GROUP_SETTINGS_C_EMPTY_H
#include "settings/SourceGroupSettingsCxxEmpty.h"
#include "settings/SourceGroupSettingsCxx.h"
#include "settings/SourceGroupSettingsWithCStandard.h"
#include "settings/SourceGroupSettingsWithCxxCrossCompilationOptions.h"
#include "settings/SourceGroupSettingsWithExcludeFilters.h"
#include "settings/SourceGroupSettingsWithSourceExtensions.h"
#include "settings/SourceGroupSettingsWithSourcePaths.h"
class SourceGroupSettingsCEmpty
: public SourceGroupSettingsCxxEmpty
: public SourceGroupSettingsCxx
, public SourceGroupSettingsWithCStandard
, public SourceGroupSettingsWithCxxCrossCompilationOptions
, public SourceGroupSettingsWithExcludeFilters
, public SourceGroupSettingsWithSourceExtensions
, public SourceGroupSettingsWithSourcePaths
{
public:
SourceGroupSettingsCEmpty(const std::string& id, const ProjectSettings* projectSettings);
@@ -1,26 +1,34 @@
#include "settings/SourceGroupSettingsCppEmpty.h"
SourceGroupSettingsCppEmpty::SourceGroupSettingsCppEmpty(const std::string& id, const ProjectSettings* projectSettings)
: SourceGroupSettingsCxxEmpty(id, SOURCE_GROUP_CPP_EMPTY, projectSettings)
: SourceGroupSettingsCxx(id, SOURCE_GROUP_CPP_EMPTY, projectSettings)
{
}
void SourceGroupSettingsCppEmpty::load(std::shared_ptr<const ConfigManager> config)
{
SourceGroupSettingsCxxEmpty::load(config);
SourceGroupSettingsCxx::load(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithCppStandard::load(config, key);
SourceGroupSettingsWithCxxCrossCompilationOptions::load(config, key);
SourceGroupSettingsWithSourceExtensions::load(config, key);
SourceGroupSettingsWithSourcePaths::load(config, key);
SourceGroupSettingsWithExcludeFilters::load(config, key);
}
void SourceGroupSettingsCppEmpty::save(std::shared_ptr<ConfigManager> config)
{
SourceGroupSettingsCxxEmpty::save(config);
SourceGroupSettingsCxx::save(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithCppStandard::save(config, key);
SourceGroupSettingsWithCxxCrossCompilationOptions::save(config, key);
SourceGroupSettingsWithSourceExtensions::save(config, key);
SourceGroupSettingsWithSourcePaths::save(config, key);
SourceGroupSettingsWithExcludeFilters::save(config, key);
}
bool SourceGroupSettingsCppEmpty::equals(std::shared_ptr<SourceGroupSettings> other) const
@@ -29,8 +37,12 @@ bool SourceGroupSettingsCppEmpty::equals(std::shared_ptr<SourceGroupSettings> ot
return (
otherCxxEmpty &&
SourceGroupSettingsCxxEmpty::equals(other) &&
SourceGroupSettingsWithCppStandard::equals(otherCxxEmpty)
SourceGroupSettingsCxx::equals(other) &&
SourceGroupSettingsWithCppStandard::equals(otherCxxEmpty) &&
SourceGroupSettingsWithCxxCrossCompilationOptions::equals(otherCxxEmpty) &&
SourceGroupSettingsWithSourceExtensions::equals(otherCxxEmpty) &&
SourceGroupSettingsWithSourcePaths::equals(otherCxxEmpty) &&
SourceGroupSettingsWithExcludeFilters::equals(otherCxxEmpty)
);
}
+10 -2
View File
@@ -1,12 +1,20 @@
#ifndef SOURCE_GROUP_SETTINGS_CPP_EMPTY_H
#define SOURCE_GROUP_SETTINGS_CPP_EMPTY_H
#include "settings/SourceGroupSettingsCxxEmpty.h"
#include "settings/SourceGroupSettingsCxx.h"
#include "settings/SourceGroupSettingsWithCppStandard.h"
#include "settings/SourceGroupSettingsWithCxxCrossCompilationOptions.h"
#include "settings/SourceGroupSettingsWithExcludeFilters.h"
#include "settings/SourceGroupSettingsWithSourceExtensions.h"
#include "settings/SourceGroupSettingsWithSourcePaths.h"
class SourceGroupSettingsCppEmpty
: public SourceGroupSettingsCxxEmpty
: public SourceGroupSettingsCxx
, public SourceGroupSettingsWithCppStandard
, public SourceGroupSettingsWithCxxCrossCompilationOptions
, public SourceGroupSettingsWithExcludeFilters
, public SourceGroupSettingsWithSourceExtensions
, public SourceGroupSettingsWithSourcePaths
{
public:
SourceGroupSettingsCppEmpty(const std::string& id, const ProjectSettings* projectSettings);
+1 -12
View File
@@ -12,10 +12,8 @@ void SourceGroupSettingsJava::load(std::shared_ptr<const ConfigManager> config)
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithSourceExtensions::load(config, key);
SourceGroupSettingsWithSourcePaths::load(config, key);
SourceGroupSettingsWithExcludeFilters::load(config, key);
SourceGroupSettingsWithJavaStandard::load(config, key);
SourceGroupSettingsWithClasspath::load(config, key);
}
void SourceGroupSettingsJava::save(std::shared_ptr<ConfigManager> config)
@@ -25,10 +23,8 @@ void SourceGroupSettingsJava::save(std::shared_ptr<ConfigManager> config)
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithSourceExtensions::save(config, key);
SourceGroupSettingsWithSourcePaths::save(config, key);
SourceGroupSettingsWithExcludeFilters::save(config, key);
SourceGroupSettingsWithJavaStandard::save(config, key);
SourceGroupSettingsWithClasspath::save(config, key);
}
bool SourceGroupSettingsJava::equals(std::shared_ptr<SourceGroupSettings> other) const
@@ -39,18 +35,11 @@ bool SourceGroupSettingsJava::equals(std::shared_ptr<SourceGroupSettings> other)
otherJava &&
SourceGroupSettings::equals(other) &&
SourceGroupSettingsWithSourceExtensions::equals(otherJava) &&
SourceGroupSettingsWithSourcePaths::equals(otherJava) &&
SourceGroupSettingsWithExcludeFilters::equals(otherJava) &&
SourceGroupSettingsWithJavaStandard::equals(otherJava) &&
SourceGroupSettingsWithClasspath::equals(otherJava)
SourceGroupSettingsWithJavaStandard::equals(otherJava)
);
}
const ProjectSettings* SourceGroupSettingsJava::getProjectSettings() const
{
return m_projectSettings;
}
std::vector<std::wstring> SourceGroupSettingsJava::getDefaultSourceExtensions() const
{
return { L".java" };
@@ -5,19 +5,15 @@
#include <vector>
#include "settings/SourceGroupSettings.h"
#include "settings/SourceGroupSettingsWithClasspath.h"
#include "settings/SourceGroupSettingsWithExcludeFilters.h"
#include "settings/SourceGroupSettingsWithJavaStandard.h"
#include "settings/SourceGroupSettingsWithSourceExtensions.h"
#include "settings/SourceGroupSettingsWithSourcePaths.h"
class SourceGroupSettingsJava
: public SourceGroupSettings
, public SourceGroupSettingsWithSourceExtensions
, public SourceGroupSettingsWithSourcePaths
, public SourceGroupSettingsWithExcludeFilters
, public SourceGroupSettingsWithJavaStandard
, public SourceGroupSettingsWithClasspath
{
public:
SourceGroupSettingsJava(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings);
@@ -28,7 +24,6 @@ public:
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
private:
const ProjectSettings* getProjectSettings() const override;
std::vector<std::wstring> getDefaultSourceExtensions() const override;
};
@@ -4,3 +4,40 @@ SourceGroupSettingsJavaEmpty::SourceGroupSettingsJavaEmpty(const std::string& id
: SourceGroupSettingsJava(id, SOURCE_GROUP_JAVA_EMPTY, projectSettings)
{
}
void SourceGroupSettingsJavaEmpty::load(std::shared_ptr<const ConfigManager> config)
{
SourceGroupSettings::load(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithSourcePaths::load(config, key);
SourceGroupSettingsWithClasspath::load(config, key);
}
void SourceGroupSettingsJavaEmpty::save(std::shared_ptr<ConfigManager> config)
{
SourceGroupSettings::save(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithSourcePaths::save(config, key);
SourceGroupSettingsWithClasspath::save(config, key);
}
bool SourceGroupSettingsJavaEmpty::equals(std::shared_ptr<SourceGroupSettings> other) const
{
std::shared_ptr<SourceGroupSettingsJavaEmpty> otherJava = std::dynamic_pointer_cast<SourceGroupSettingsJavaEmpty>(other);
return (
otherJava &&
SourceGroupSettingsJava::equals(other) &&
SourceGroupSettingsWithSourcePaths::equals(otherJava) &&
SourceGroupSettingsWithClasspath::equals(otherJava)
);
}
const ProjectSettings* SourceGroupSettingsJavaEmpty::getProjectSettings() const
{
return m_projectSettings;
}
@@ -2,12 +2,24 @@
#define SOURCE_GROUP_SETTINGS_JAVA_EMPTY_H
#include "settings/SourceGroupSettingsJava.h"
#include "settings/SourceGroupSettingsWithClasspath.h"
#include "settings/SourceGroupSettingsWithSourcePaths.h"
class SourceGroupSettingsJavaEmpty
: public SourceGroupSettingsJava
, public SourceGroupSettingsWithSourcePaths
, public SourceGroupSettingsWithClasspath
{
public:
SourceGroupSettingsJavaEmpty(const std::string& id, const ProjectSettings* projectSettings);
void load(std::shared_ptr<const ConfigManager> config) override;
void save(std::shared_ptr<ConfigManager> config) override;
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
private:
const ProjectSettings* getProjectSettings() const override;
};
#endif // SOURCE_GROUP_SETTINGS_JAVA_EMPTY_H
@@ -85,3 +85,8 @@ void SourceGroupSettingsJavaGradle::setShouldIndexGradleTests(bool value)
{
m_shouldIndexGradleTests = value;
}
const ProjectSettings* SourceGroupSettingsJavaGradle::getProjectSettings() const
{
return m_projectSettings;
}
@@ -2,6 +2,7 @@
#define SOURCE_GROUP_SETTINGS_JAVA_GRADLE_H
#include "settings/SourceGroupSettingsJava.h"
#include "utility/file/FilePath.h"
class SourceGroupSettingsJavaGradle
: public SourceGroupSettingsJava
@@ -26,6 +27,8 @@ public:
void setShouldIndexGradleTests(bool value);
private:
const ProjectSettings* getProjectSettings() const override;
FilePath m_gradleProjectFilePath;
FilePath m_gradleDependenciesDirectory;
bool m_shouldIndexGradleTests;
@@ -85,3 +85,8 @@ void SourceGroupSettingsJavaMaven::setShouldIndexMavenTests(bool value)
{
m_shouldIndexMavenTests = value;
}
const ProjectSettings* SourceGroupSettingsJavaMaven::getProjectSettings() const
{
return m_projectSettings;
}
@@ -2,6 +2,7 @@
#define SOURCE_GROUP_SETTINGS_JAVA_MAVEN_H
#include "settings/SourceGroupSettingsJava.h"
#include "utility/file/FilePath.h"
class SourceGroupSettingsJavaMaven
: public SourceGroupSettingsJava
@@ -26,6 +27,8 @@ public:
void setShouldIndexMavenTests(bool value);
private:
const ProjectSettings* getProjectSettings() const override;
FilePath m_mavenProjectFilePath;
FilePath m_mavenDependenciesDirectory;
bool m_shouldIndexMavenTests;
@@ -1,12 +1,11 @@
#include "settings/SourceGroupSettingsCxxEmpty.h"
#include "settings/SourceGroupSettingsWithCxxCrossCompilationOptions.h"
#include "utility/ConfigManager.h"
#include "utility/utility.h"
#include "utility/utilityApp.h"
#include "settings/ProjectSettings.h"
std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableArchTypes()
std::vector<std::wstring> SourceGroupSettingsWithCxxCrossCompilationOptions::getAvailableArchTypes()
{
return {
return{
L"aarch64",
L"aarch64_be",
L"arm",
@@ -58,9 +57,9 @@ std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableArchTypes()
};
}
std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableVendorTypes()
std::vector<std::wstring> SourceGroupSettingsWithCxxCrossCompilationOptions::getAvailableVendorTypes()
{
return {
return{
L"unknown",
L"apple",
L"pc",
@@ -79,9 +78,9 @@ std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableVendorTypes()
};
}
std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableOsTypes()
std::vector<std::wstring> SourceGroupSettingsWithCxxCrossCompilationOptions::getAvailableOsTypes()
{
return {
return{
L"unknown",
L"cloudabi",
L"darwin",
@@ -116,9 +115,9 @@ std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableOsTypes()
};
}
std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableEnvironmentTypes()
std::vector<std::wstring> SourceGroupSettingsWithCxxCrossCompilationOptions::getAvailableEnvironmentTypes()
{
return {
return{
L"unknown",
L"gnu",
L"gnuabi64",
@@ -141,9 +140,8 @@ std::vector<std::wstring> SourceGroupSettingsCxxEmpty::getAvailableEnvironmentTy
};
}
SourceGroupSettingsCxxEmpty::SourceGroupSettingsCxxEmpty(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings)
: SourceGroupSettingsCxx(id, type, projectSettings)
, m_targetOptionsEnabled(false)
SourceGroupSettingsWithCxxCrossCompilationOptions::SourceGroupSettingsWithCxxCrossCompilationOptions()
: m_targetOptionsEnabled(false)
, m_targetArch(L"")
, m_targetVendor(L"")
, m_targetSys(L"")
@@ -151,16 +149,16 @@ SourceGroupSettingsCxxEmpty::SourceGroupSettingsCxxEmpty(const std::string& id,
{
}
void SourceGroupSettingsCxxEmpty::load(std::shared_ptr<const ConfigManager> config)
bool SourceGroupSettingsWithCxxCrossCompilationOptions::equals(std::shared_ptr<SourceGroupSettingsWithCxxCrossCompilationOptions> other) const
{
SourceGroupSettingsCxx::load(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithSourceExtensions::load(config, key);
SourceGroupSettingsWithSourcePaths::load(config, key);
SourceGroupSettingsWithExcludeFilters::load(config, key);
return (
other &&
getTargetFlag() == other->getTargetFlag()
);
}
void SourceGroupSettingsWithCxxCrossCompilationOptions::load(std::shared_ptr<const ConfigManager> config, const std::string& key)
{
setTargetOptionsEnabled(config->getValueOrDefault<bool>(key + "/cross_compilation/target_options_enabled", false));
setTargetArch(config->getValueOrDefault<std::wstring>(key + "/cross_compilation/target/arch", L""));
setTargetVendor(config->getValueOrDefault<std::wstring>(key + "/cross_compilation/target/vendor", L""));
@@ -168,16 +166,8 @@ void SourceGroupSettingsCxxEmpty::load(std::shared_ptr<const ConfigManager> conf
setTargetAbi(config->getValueOrDefault<std::wstring>(key + "/cross_compilation/target/abi", L""));
}
void SourceGroupSettingsCxxEmpty::save(std::shared_ptr<ConfigManager> config)
void SourceGroupSettingsWithCxxCrossCompilationOptions::save(std::shared_ptr<ConfigManager> config, const std::string& key)
{
SourceGroupSettingsCxx::save(config);
const std::string key = s_keyPrefix + getId();
SourceGroupSettingsWithSourceExtensions::save(config, key);
SourceGroupSettingsWithSourcePaths::save(config, key);
SourceGroupSettingsWithExcludeFilters::save(config, key);
config->setValue(key + "/cross_compilation/target_options_enabled", getTargetOptionsEnabled());
config->setValue(key + "/cross_compilation/target/arch", getTargetArch());
config->setValue(key + "/cross_compilation/target/vendor", getTargetVendor());
@@ -185,71 +175,57 @@ void SourceGroupSettingsCxxEmpty::save(std::shared_ptr<ConfigManager> config)
config->setValue(key + "/cross_compilation/target/abi", getTargetAbi());
}
bool SourceGroupSettingsCxxEmpty::equals(std::shared_ptr<SourceGroupSettings> other) const
{
std::shared_ptr<SourceGroupSettingsCxxEmpty> otherCxxEmpty = std::dynamic_pointer_cast<SourceGroupSettingsCxxEmpty>(other);
return (
otherCxxEmpty &&
SourceGroupSettingsCxx::equals(other) &&
SourceGroupSettingsWithSourceExtensions::equals(otherCxxEmpty) &&
SourceGroupSettingsWithSourcePaths::equals(otherCxxEmpty) &&
SourceGroupSettingsWithExcludeFilters::equals(otherCxxEmpty) &&
getTargetFlag() == otherCxxEmpty->getTargetFlag()
);
}
bool SourceGroupSettingsCxxEmpty::getTargetOptionsEnabled() const
bool SourceGroupSettingsWithCxxCrossCompilationOptions::getTargetOptionsEnabled() const
{
return m_targetOptionsEnabled;
}
void SourceGroupSettingsCxxEmpty::setTargetOptionsEnabled(bool targetOptionsEnabled)
void SourceGroupSettingsWithCxxCrossCompilationOptions::setTargetOptionsEnabled(bool targetOptionsEnabled)
{
m_targetOptionsEnabled = targetOptionsEnabled;
}
std::wstring SourceGroupSettingsCxxEmpty::getTargetArch() const
std::wstring SourceGroupSettingsWithCxxCrossCompilationOptions::getTargetArch() const
{
return m_targetArch;
}
void SourceGroupSettingsCxxEmpty::setTargetArch(const std::wstring& arch)
void SourceGroupSettingsWithCxxCrossCompilationOptions::setTargetArch(const std::wstring& arch)
{
m_targetArch = arch;
}
std::wstring SourceGroupSettingsCxxEmpty::getTargetVendor() const
std::wstring SourceGroupSettingsWithCxxCrossCompilationOptions::getTargetVendor() const
{
return m_targetVendor;
}
void SourceGroupSettingsCxxEmpty::setTargetVendor(const std::wstring& vendor)
void SourceGroupSettingsWithCxxCrossCompilationOptions::setTargetVendor(const std::wstring& vendor)
{
m_targetVendor = vendor;
}
std::wstring SourceGroupSettingsCxxEmpty::getTargetSys() const
std::wstring SourceGroupSettingsWithCxxCrossCompilationOptions::getTargetSys() const
{
return m_targetSys;
}
void SourceGroupSettingsCxxEmpty::setTargetSys(const std::wstring& sys)
void SourceGroupSettingsWithCxxCrossCompilationOptions::setTargetSys(const std::wstring& sys)
{
m_targetSys = sys;
}
std::wstring SourceGroupSettingsCxxEmpty::getTargetAbi() const
std::wstring SourceGroupSettingsWithCxxCrossCompilationOptions::getTargetAbi() const
{
return m_targetAbi;
}
void SourceGroupSettingsCxxEmpty::setTargetAbi(const std::wstring& abi)
void SourceGroupSettingsWithCxxCrossCompilationOptions::setTargetAbi(const std::wstring& abi)
{
m_targetAbi = abi;
}
std::wstring SourceGroupSettingsCxxEmpty::getTargetFlag() const
std::wstring SourceGroupSettingsWithCxxCrossCompilationOptions::getTargetFlag() const
{
std::wstring targetFlag = L"";
if (m_targetOptionsEnabled && !m_targetArch.empty())
@@ -261,4 +237,4 @@ std::wstring SourceGroupSettingsCxxEmpty::getTargetFlag() const
targetFlag += L"-" + (m_targetAbi.empty() ? L"unknown" : m_targetAbi);
}
return targetFlag;
}
}
@@ -1,16 +1,14 @@
#ifndef SOURCE_GROUP_SETTINGS_CXX_EMPTY_H
#define SOURCE_GROUP_SETTINGS_CXX_EMPTY_H
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H
#include "settings/SourceGroupSettingsCxx.h"
#include "settings/SourceGroupSettingsWithExcludeFilters.h"
#include "settings/SourceGroupSettingsWithSourceExtensions.h"
#include "settings/SourceGroupSettingsWithSourcePaths.h"
#include <memory>
#include <string>
#include <vector>
class SourceGroupSettingsCxxEmpty
: public SourceGroupSettingsCxx
, public SourceGroupSettingsWithExcludeFilters
, public SourceGroupSettingsWithSourceExtensions
, public SourceGroupSettingsWithSourcePaths
class ConfigManager;
class ProjectSettings;
class SourceGroupSettingsWithCxxCrossCompilationOptions
{
public:
static std::vector<std::wstring> getAvailableArchTypes();
@@ -18,12 +16,10 @@ public:
static std::vector<std::wstring> getAvailableOsTypes();
static std::vector<std::wstring> getAvailableEnvironmentTypes();
SourceGroupSettingsCxxEmpty(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings);
SourceGroupSettingsWithCxxCrossCompilationOptions();
virtual ~SourceGroupSettingsWithCxxCrossCompilationOptions() = default;
void load(std::shared_ptr<const ConfigManager> config) override;
void save(std::shared_ptr<ConfigManager> config) override;
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
bool equals(std::shared_ptr<SourceGroupSettingsWithCxxCrossCompilationOptions> other) const;
bool getTargetOptionsEnabled() const;
void setTargetOptionsEnabled(bool targetOptionsEnabled);
@@ -42,7 +38,13 @@ public:
std::wstring getTargetFlag() const;
protected:
void load(std::shared_ptr<const ConfigManager> config, const std::string& key);
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
private:
virtual const ProjectSettings* getProjectSettings() const = 0;
bool m_targetOptionsEnabled;
std::wstring m_targetArch;
std::wstring m_targetVendor;
@@ -50,4 +52,4 @@ private:
std::wstring m_targetAbi;
};
#endif // SOURCE_GROUP_SETTINGS_CXX_EMPTY_H
#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H