logic: added Gradle project setup (issue #379)
* added implementation for Gradle project setup (icon is still missing) * refactored project loading/saving and SourceGroupSettings * removed long deprecated Cxx UseSourcePathsForHeaderSearch option fortune cookie message = There is true and sincere friendship between you and your friends.
This commit is contained in:
@@ -3,156 +3,11 @@
|
||||
#include "utility/utility.h"
|
||||
#include "utility/utilityApp.h"
|
||||
|
||||
std::vector<std::string> SourceGroupSettingsCxx::getAvailableArchTypes()
|
||||
{
|
||||
return {
|
||||
"aarch64",
|
||||
"aarch64_be",
|
||||
"arm",
|
||||
"armeb",
|
||||
"avr",
|
||||
"bpfel",
|
||||
"bpfeb",
|
||||
"hexagon",
|
||||
"mips",
|
||||
"mipsel",
|
||||
"mips64",
|
||||
"mips64el",
|
||||
"msp430",
|
||||
"powerpc64",
|
||||
"powerpc64le",
|
||||
"powerpc",
|
||||
"r600",
|
||||
"amdgcn",
|
||||
"riscv32",
|
||||
"riscv64",
|
||||
"sparc",
|
||||
"sparcv9",
|
||||
"sparcel",
|
||||
"s390x",
|
||||
"tce",
|
||||
"tcele",
|
||||
"thumb",
|
||||
"thumbeb",
|
||||
"i386",
|
||||
"x86_64",
|
||||
"xcore",
|
||||
"nvptx",
|
||||
"nvptx64",
|
||||
"le32",
|
||||
"le64",
|
||||
"amdil",
|
||||
"amdil64",
|
||||
"hsail",
|
||||
"hsail64",
|
||||
"spir",
|
||||
"spir64",
|
||||
"kalimba",
|
||||
"lanai",
|
||||
"shave",
|
||||
"wasm32",
|
||||
"wasm64",
|
||||
"renderscript32",
|
||||
"renderscript64",
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<std::string> SourceGroupSettingsCxx::getAvailableVendorTypes()
|
||||
{
|
||||
return {
|
||||
"unknown",
|
||||
"apple",
|
||||
"pc",
|
||||
"scei",
|
||||
"bgp",
|
||||
"bgq",
|
||||
"fsl",
|
||||
"ibm",
|
||||
"img",
|
||||
"mti",
|
||||
"nvidia",
|
||||
"csr",
|
||||
"myriad",
|
||||
"amd",
|
||||
"mesa"
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<std::string> SourceGroupSettingsCxx::getAvailableOsTypes()
|
||||
{
|
||||
return {
|
||||
"unknown",
|
||||
"cloudabi",
|
||||
"darwin",
|
||||
"dragonfly",
|
||||
"freebsd",
|
||||
"fuchsia",
|
||||
"ios",
|
||||
"kfreebsd",
|
||||
"linux",
|
||||
"lv2",
|
||||
"macosx",
|
||||
"netbsd",
|
||||
"openbsd",
|
||||
"solaris",
|
||||
"windows",
|
||||
"haiku",
|
||||
"minix",
|
||||
"rtems",
|
||||
"nacl",
|
||||
"cnk",
|
||||
"bitrig",
|
||||
"aix",
|
||||
"cuda",
|
||||
"nvcl",
|
||||
"amdhsa",
|
||||
"ps4",
|
||||
"elfiamcu",
|
||||
"tvos",
|
||||
"watchos",
|
||||
"mesa3d",
|
||||
"contiki"
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<std::string> SourceGroupSettingsCxx::getAvailableEnvironmentTypes()
|
||||
{
|
||||
return {
|
||||
"unknown",
|
||||
"gnu",
|
||||
"gnuabi64",
|
||||
"gnueabihf",
|
||||
"gnueabi",
|
||||
"gnux32",
|
||||
"code16",
|
||||
"eabi",
|
||||
"eabihf",
|
||||
"android",
|
||||
"musl",
|
||||
"musleabi",
|
||||
"musleabihf",
|
||||
"msvc",
|
||||
"itanium",
|
||||
"cygnus",
|
||||
"amdopencl",
|
||||
"coreclr",
|
||||
"opencl"
|
||||
};
|
||||
}
|
||||
|
||||
SourceGroupSettingsCxx::SourceGroupSettingsCxx(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings)
|
||||
: SourceGroupSettings(id, type, projectSettings)
|
||||
, m_headerSearchPaths(std::vector<FilePath>())
|
||||
, m_frameworkSearchPaths(std::vector<FilePath>())
|
||||
, m_targetOptionsEnabled(false)
|
||||
, m_targetArch("")
|
||||
, m_targetVendor("")
|
||||
, m_targetSys("")
|
||||
, m_targetAbi("")
|
||||
, m_compilerFlags(std::vector<std::string>())
|
||||
, m_useSourcePathsForHeaderSearch(false)
|
||||
, m_hasDefinedUseSourcePathsForHeaderSearch(false)
|
||||
, m_compilationDatabasePath(FilePath())
|
||||
, m_shouldApplyAnonymousTypedefTransformation(true)
|
||||
{
|
||||
}
|
||||
@@ -161,6 +16,30 @@ SourceGroupSettingsCxx::~SourceGroupSettingsCxx()
|
||||
{
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::load(std::shared_ptr<const ConfigManager> config)
|
||||
{
|
||||
SourceGroupSettings::load(config);
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setHeaderSearchPaths(getPathValues(key + "/header_search_paths/header_search_path", config));
|
||||
setFrameworkSearchPaths(getPathValues(key + "/framework_search_paths/framework_search_path", config));
|
||||
setCompilerFlags(getValues<std::string>(key + "/compiler_flags/compiler_flag", std::vector<std::string>(), config));
|
||||
setShouldApplyAnonymousTypedefTransformation(getValue<bool>(key + "/should_apply_anonymous_typedef_transformation", true, config));
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::save(std::shared_ptr<ConfigManager> config)
|
||||
{
|
||||
SourceGroupSettings::save(config);
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setPathValues(key + "/header_search_paths/header_search_path", getHeaderSearchPaths(), config);
|
||||
setPathValues(key + "/framework_search_paths/framework_search_path", getFrameworkSearchPaths(), config);
|
||||
setValues(key + "/compiler_flags/compiler_flag", getCompilerFlags(), config);
|
||||
setValue(key + "/should_apply_anonymous_typedef_transformation", getShouldApplyAnonymousTypedefTransformation(), config);
|
||||
}
|
||||
|
||||
bool SourceGroupSettingsCxx::equals(std::shared_ptr<SourceGroupSettings> other) const
|
||||
{
|
||||
std::shared_ptr<SourceGroupSettingsCxx> otherCxx = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(other);
|
||||
@@ -170,11 +49,7 @@ bool SourceGroupSettingsCxx::equals(std::shared_ptr<SourceGroupSettings> other)
|
||||
SourceGroupSettings::equals(other) &&
|
||||
utility::isPermutation(m_headerSearchPaths, otherCxx->m_headerSearchPaths) &&
|
||||
utility::isPermutation(m_frameworkSearchPaths, otherCxx->m_frameworkSearchPaths) &&
|
||||
utility::isPermutation(m_compilerFlags, otherCxx->m_compilerFlags) &&
|
||||
m_useSourcePathsForHeaderSearch == otherCxx->m_useSourcePathsForHeaderSearch &&
|
||||
m_hasDefinedUseSourcePathsForHeaderSearch == otherCxx->m_hasDefinedUseSourcePathsForHeaderSearch &&
|
||||
m_compilationDatabasePath == otherCxx->m_compilationDatabasePath &&
|
||||
getTargetFlag() == otherCxx->getTargetFlag()
|
||||
utility::isPermutation(m_compilerFlags, otherCxx->m_compilerFlags)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -271,70 +146,6 @@ void SourceGroupSettingsCxx::setFrameworkSearchPaths(const std::vector<FilePath>
|
||||
m_frameworkSearchPaths = frameworkSearchPaths;
|
||||
}
|
||||
|
||||
bool SourceGroupSettingsCxx::getTargetOptionsEnabled() const
|
||||
{
|
||||
return m_targetOptionsEnabled;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setTargetOptionsEnabled(bool targetOptionsEnabled)
|
||||
{
|
||||
m_targetOptionsEnabled = targetOptionsEnabled;
|
||||
}
|
||||
|
||||
std::string SourceGroupSettingsCxx::getTargetArch() const
|
||||
{
|
||||
return m_targetArch;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setTargetArch(const std::string& arch)
|
||||
{
|
||||
m_targetArch = arch;
|
||||
}
|
||||
|
||||
std::string SourceGroupSettingsCxx::getTargetVendor() const
|
||||
{
|
||||
return m_targetVendor;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setTargetVendor(const std::string& vendor)
|
||||
{
|
||||
m_targetVendor = vendor;
|
||||
}
|
||||
|
||||
std::string SourceGroupSettingsCxx::getTargetSys() const
|
||||
{
|
||||
return m_targetSys;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setTargetSys(const std::string& sys)
|
||||
{
|
||||
m_targetSys = sys;
|
||||
}
|
||||
|
||||
std::string SourceGroupSettingsCxx::getTargetAbi() const
|
||||
{
|
||||
return m_targetAbi;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setTargetAbi(const std::string& abi)
|
||||
{
|
||||
m_targetAbi = abi;
|
||||
}
|
||||
|
||||
std::string SourceGroupSettingsCxx::getTargetFlag() const
|
||||
{
|
||||
std::string targetFlag = "";
|
||||
if (m_targetOptionsEnabled && !m_targetArch.empty())
|
||||
{
|
||||
targetFlag = "--target=";
|
||||
targetFlag += m_targetArch;
|
||||
targetFlag += "-" + (m_targetVendor.empty() ? "unknown" : m_targetVendor);
|
||||
targetFlag += "-" + (m_targetSys.empty() ? "unknown" : m_targetSys);
|
||||
targetFlag += "-" + (m_targetAbi.empty() ? "unknown" : m_targetAbi);
|
||||
}
|
||||
return targetFlag;
|
||||
}
|
||||
|
||||
std::vector<std::string> SourceGroupSettingsCxx::getCompilerFlags() const
|
||||
{
|
||||
return m_compilerFlags;
|
||||
@@ -345,41 +156,6 @@ void SourceGroupSettingsCxx::setCompilerFlags(const std::vector<std::string>& co
|
||||
m_compilerFlags = compilerFlags;
|
||||
}
|
||||
|
||||
bool SourceGroupSettingsCxx::getUseSourcePathsForHeaderSearch() const
|
||||
{
|
||||
return m_useSourcePathsForHeaderSearch;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setUseSourcePathsForHeaderSearch(bool useSourcePathsForHeaderSearch)
|
||||
{
|
||||
m_useSourcePathsForHeaderSearch = useSourcePathsForHeaderSearch;
|
||||
}
|
||||
|
||||
bool SourceGroupSettingsCxx::getHasDefinedUseSourcePathsForHeaderSearch() const
|
||||
{
|
||||
return m_hasDefinedUseSourcePathsForHeaderSearch;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setHasDefinedUseSourcePathsForHeaderSearch(bool hasDefinedUseSourcePathsForHeaderSearch)
|
||||
{
|
||||
m_hasDefinedUseSourcePathsForHeaderSearch = hasDefinedUseSourcePathsForHeaderSearch;
|
||||
}
|
||||
|
||||
FilePath SourceGroupSettingsCxx::getCompilationDatabasePath() const
|
||||
{
|
||||
return m_compilationDatabasePath;
|
||||
}
|
||||
|
||||
FilePath SourceGroupSettingsCxx::getCompilationDatabasePathExpandedAndAbsolute() const
|
||||
{
|
||||
return m_projectSettings->makePathExpandedAndAbsolute(getCompilationDatabasePath());
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCxx::setCompilationDatabasePath(const FilePath& compilationDatabasePath)
|
||||
{
|
||||
m_compilationDatabasePath = compilationDatabasePath;
|
||||
}
|
||||
|
||||
bool SourceGroupSettingsCxx::getShouldApplyAnonymousTypedefTransformation() const
|
||||
{
|
||||
return m_shouldApplyAnonymousTypedefTransformation;
|
||||
|
||||
Reference in New Issue
Block a user