@@ -544,6 +544,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
544544 else if (std::strncmp (argv[i]," --addon-python=" , 15 ) == 0 )
545545 mSettings .addonPython .assign (argv[i]+15 );
546546
547+ else if (std::strcmp (argv[i]," --analyze-all-vs-configs" ) == 0 )
548+ mSettings .analyzeAllVsConfigs = true ;
549+
547550 // Check configuration
548551 else if (std::strcmp (argv[i], " --check-config" ) == 0 )
549552 mSettings .checkConfiguration = true ;
@@ -1018,6 +1021,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
10181021 return Result::Fail;
10191022 }
10201023
1024+ else if (std::strcmp (argv[i]," --no-analyze-all-vs-configs" ) == 0 )
1025+ mSettings .analyzeAllVsConfigs = false ;
1026+
10211027 else if (std::strcmp (argv[i], " --no-check-headers" ) == 0 )
10221028 mSettings .checkHeaders = false ;
10231029
@@ -1202,8 +1208,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
12021208 }
12031209 }
12041210 if (projectType == ImportProject::Type::VS_SLN || projectType == ImportProject::Type::VS_VCXPROJ) {
1205- if (project.guiProject .analyzeAllVsConfigs == " false" )
1206- project.selectOneVsConfig (mSettings .platform .type );
12071211 mSettings .libraries .emplace_back (" windows" );
12081212 }
12091213 if (projectType == ImportProject::Type::MISSING) {
@@ -1605,10 +1609,22 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
16051609 return Result::Fail;
16061610 }
16071611
1612+ // TODO: conflicts with analyzeAllVsConfigs
16081613 if (!vsConfig.empty ()) {
1614+ // TODO: bail out when this does nothing
16091615 project.ignoreOtherConfigs (vsConfig);
16101616 }
16111617
1618+ if (!mSettings .analyzeAllVsConfigs ) {
1619+ if (projectType != ImportProject::Type::VS_SLN && projectType != ImportProject::Type::VS_VCXPROJ) {
1620+ mLogger .printError (" --no-analyze-all-vs-configs has no effect - no Visual Studio project provided." );
1621+ return Result::Fail;
1622+ }
1623+
1624+ // TODO: bail out when this does nothing
1625+ project.selectOneVsConfig (mSettings .platform .type );
1626+ }
1627+
16121628 if (!mSettings .buildDir .empty () && !Path::isDirectory (mSettings .buildDir )) {
16131629 mLogger .printError (" Directory '" + mSettings .buildDir + " ' specified by --cppcheck-build-dir argument has to be existent." );
16141630 return Result::Fail;
0 commit comments