ImportProject: Improve cppcheckDefines()
This commit is contained in:
parent
9861240e79
commit
c0890b5255
|
@ -495,6 +495,8 @@ void ImportProject::importVcxproj(const std::string &filename, std::map<std::str
|
||||||
FileSettings fs;
|
FileSettings fs;
|
||||||
fs.filename = Path::simplifyPath(Path::isAbsolute(*c) ? *c : Path::getPathFromFilename(filename) + *c);
|
fs.filename = Path::simplifyPath(Path::isAbsolute(*c) ? *c : Path::getPathFromFilename(filename) + *c);
|
||||||
fs.cfg = p->name;
|
fs.cfg = p->name;
|
||||||
|
fs.msc = true;
|
||||||
|
fs.useMfc = useOfMfc;
|
||||||
fs.defines = "_WIN32=1";
|
fs.defines = "_WIN32=1";
|
||||||
if (p->platform == ProjectConfiguration::Win32)
|
if (p->platform == ProjectConfiguration::Win32)
|
||||||
fs.platformType = cppcheck::Platform::Win32W;
|
fs.platformType = cppcheck::Platform::Win32W;
|
||||||
|
@ -502,7 +504,6 @@ void ImportProject::importVcxproj(const std::string &filename, std::map<std::str
|
||||||
fs.platformType = cppcheck::Platform::Win64;
|
fs.platformType = cppcheck::Platform::Win64;
|
||||||
fs.defines += ";_WIN64=1";
|
fs.defines += ";_WIN64=1";
|
||||||
}
|
}
|
||||||
fs.useMfc = useOfMfc;
|
|
||||||
std::string additionalIncludePaths;
|
std::string additionalIncludePaths;
|
||||||
for (std::list<ItemDefinitionGroup>::const_iterator i = itemDefinitionGroupList.begin(); i != itemDefinitionGroupList.end(); ++i) {
|
for (std::list<ItemDefinitionGroup>::const_iterator i = itemDefinitionGroupList.begin(); i != itemDefinitionGroupList.end(); ++i) {
|
||||||
if (!i->conditionIsTrue(*p))
|
if (!i->conditionIsTrue(*p))
|
||||||
|
|
|
@ -40,18 +40,19 @@ class CPPCHECKLIB ImportProject {
|
||||||
public:
|
public:
|
||||||
/** File settings. Multiple configurations for a file is allowed. */
|
/** File settings. Multiple configurations for a file is allowed. */
|
||||||
struct FileSettings {
|
struct FileSettings {
|
||||||
FileSettings() : platformType(cppcheck::Platform::Unspecified), useMfc(false) {}
|
FileSettings() : platformType(cppcheck::Platform::Unspecified), msc(false), useMfc(false) {}
|
||||||
std::string cfg;
|
std::string cfg;
|
||||||
std::string filename;
|
std::string filename;
|
||||||
std::string defines;
|
std::string defines;
|
||||||
std::string cppcheckDefines() const {
|
std::string cppcheckDefines() const {
|
||||||
return useMfc ? (defines + ";_MSC_VER=1900;__AFXWIN_H__=1") : defines;
|
return defines + (msc ? ";_MSC_VER=1900" : "") + (useMfc ? ";__AFXWIN_H__=1" : "");
|
||||||
}
|
}
|
||||||
std::set<std::string> undefs;
|
std::set<std::string> undefs;
|
||||||
std::list<std::string> includePaths;
|
std::list<std::string> includePaths;
|
||||||
std::list<std::string> systemIncludePaths;
|
std::list<std::string> systemIncludePaths;
|
||||||
std::string standard;
|
std::string standard;
|
||||||
cppcheck::Platform::PlatformType platformType;
|
cppcheck::Platform::PlatformType platformType;
|
||||||
|
bool msc;
|
||||||
bool useMfc;
|
bool useMfc;
|
||||||
|
|
||||||
void setDefines(std::string defs);
|
void setDefines(std::string defs);
|
||||||
|
|
Loading…
Reference in New Issue