MCPcopy Create free account
hub / github.com/Kitware/CMake / Parse

Method Parse

Source/cmcmd.cxx:3019–3108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3017}
3018
3019bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
3020 std::vector<std::string>::const_iterator argEnd)
3021{
3022 // Parse our own arguments.
3023 std::string intDir;
3024 auto arg = argBeg;
3025 while (arg != argEnd && cmHasPrefix(*arg, '-')) {
3026 if (*arg == "--") {
3027 ++arg;
3028 break;
3029 }
3030 if (*arg == "--manifests") {
3031 for (++arg; arg != argEnd && !cmHasPrefix(*arg, '-'); ++arg) {
3032 this->UserManifests.push_back(*arg);
3033 }
3034 } else if (cmHasLiteralPrefix(*arg, "--intdir=")) {
3035 intDir = arg->substr(9);
3036 ++arg;
3037 } else if (cmHasLiteralPrefix(*arg, "--rc=")) {
3038 this->RcPath = arg->substr(5);
3039 ++arg;
3040 } else if (cmHasLiteralPrefix(*arg, "--mt=")) {
3041 this->MtPath = arg->substr(5);
3042 ++arg;
3043 } else if (cmHasLiteralPrefix(*arg, "--msvc-ver=")) {
3044 unsigned long msvc_ver = 0;
3045 if (cmStrToULong(arg->c_str() + 11, &msvc_ver)) {
3046 this->LinkEmbedsManifest = msvc_ver > 1600;
3047 }
3048 ++arg;
3049 } else {
3050 std::cerr << "unknown argument '" << *arg << "'\n";
3051 return false;
3052 }
3053 }
3054 if (intDir.empty()) {
3055 return false;
3056 }
3057
3058 // The rest of the arguments form the link command.
3059 if (arg == argEnd) {
3060 return false;
3061 }
3062 this->LinkCommand.insert(this->LinkCommand.begin(), arg, argEnd);
3063
3064 // Parse the link command to extract information we need.
3065 for (; arg != argEnd; ++arg) {
3066 if (cmSystemTools::Strucmp(arg->c_str(), "/INCREMENTAL:YES") == 0 ||
3067 cmSystemTools::Strucmp(arg->c_str(), "-INCREMENTAL:YES") == 0 ||
3068 cmSystemTools::Strucmp(arg->c_str(), "/INCREMENTAL") == 0 ||
3069 cmSystemTools::Strucmp(arg->c_str(), "-INCREMENTAL") == 0) {
3070 this->Incremental = true;
3071 } else if (cmSystemTools::Strucmp(arg->c_str(), "/INCREMENTAL:NO") == 0 ||
3072 cmSystemTools::Strucmp(arg->c_str(), "-INCREMENTAL:NO") == 0) {
3073 this->Incremental = false;
3074 } else if (cmSystemTools::Strucmp(arg->c_str(), "/MANIFEST:NO") == 0 ||
3075 cmSystemTools::Strucmp(arg->c_str(), "-MANIFEST:NO") == 0) {
3076 this->LinkGeneratesManifest = false;

Callers 15

RapidDeserializerMethod · 0.45
ExpandLinkItemsMethod · 0.45
AddObjectEntriesFunction · 0.45
HandleTargetsModeFunction · 0.45
HandleFilesModeFunction · 0.45
HandleExportModeFunction · 0.45
HandlePackageInfoModeFunction · 0.45
HandleSbomModeFunction · 0.45

Calls 11

cmHasPrefixFunction · 0.85
cmHasLiteralPrefixFunction · 0.85
cmStrToULongFunction · 0.85
StrucmpFunction · 0.85
push_backMethod · 0.80
c_strMethod · 0.80
emplace_backMethod · 0.80
substrMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by 3