MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / main

Function main

tools/dmake/dmake.cpp:436–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436int main(int argc, char **argv)
437{
438 const bool release(argc >= 2 && std::string(argv[1]) == "--release");
439
440 // Get files..
441 std::vector<std::string> libfiles;
442 std::string err = getCppFiles(libfiles, "lib/", false);
443 if (!err.empty()) {
444 std::cerr << err << std::endl;
445 return EXIT_FAILURE;
446 }
447 const std::vector<std::string> libfiles_prio = prioritizelib(libfiles);
448
449 std::vector<std::string> extfiles;
450 err = getCppFiles(extfiles, "externals/", true);
451 if (!err.empty()) {
452 std::cerr << err << std::endl;
453 return EXIT_FAILURE;
454 }
455
456 std::vector<std::string> frontendfiles;
457 err = getCppFiles(frontendfiles, "frontend/", false);
458 if (!err.empty()) {
459 std::cerr << err << std::endl;
460 return EXIT_FAILURE;
461 }
462
463 std::vector<std::string> clifiles;
464 err = getCppFiles(clifiles, "cli/", false);
465 if (!err.empty()) {
466 std::cerr << err << std::endl;
467 return EXIT_FAILURE;
468 }
469
470 std::vector<std::string> testfiles;
471 err = getCppFiles(testfiles, "test/", false);
472 if (!err.empty()) {
473 std::cerr << err << std::endl;
474 return EXIT_FAILURE;
475 }
476
477 std::vector<std::string> toolsfiles;
478 err = getCppFiles(toolsfiles, "tools/dmake/", false);
479 if (!err.empty()) {
480 std::cerr << err << std::endl;
481 return EXIT_FAILURE;
482 }
483
484 if (libfiles.empty() && frontendfiles.empty() && clifiles.empty() && testfiles.empty()) {
485 std::cerr << "No files found. Are you in the correct directory?" << std::endl;
486 return EXIT_FAILURE;
487 }
488
489 // TODO: add files without source via parsing
490 std::set<std::string> libfiles_h;
491 for (const std::string &libfile : libfiles) {
492 std::string fname(libfile.substr(4));
493 fname.erase(fname.find(".cpp"));

Callers

nothing calls this directly

Calls 12

getCppFilesFunction · 0.85
prioritizelibFunction · 0.85
write_vcxprojFunction · 0.85
make_vcxproj_cl_entryFunction · 0.85
makeConditionalVariableFunction · 0.85
makeMatchcompilerFunction · 0.85
objfilesFunction · 0.85
compilefilesFunction · 0.85
write_ossfuzz_makefileFunction · 0.85
emptyMethod · 0.45
eraseMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected