32 for(std::size_t i = 0; i < arguments.size(); i++)
35 if(std::string(arguments[i], 0, 2) ==
"--")
39 if(arguments[i] ==
"--verbosity")
41 if(i < arguments.size() - 1)
43 set(arguments[i], arguments[i + 1]);
48 else if(!arguments[i].empty() && arguments[i][0] ==
'@')
67 std::vector<std::string> arguments;
70 for(
int i = 1; i < argc; i++)
71 arguments.push_back(argv[i]);
73 return parse(arguments);
76 static std::istream &
my_wgetline(std::istream &in, std::wstring &dest)
105 dest += wchar_t(ch1 + (ch2 << 8));
114 std::ifstream infile(
file);
118 std::cerr <<
"failed to open response file '" <<
file <<
"'\n";
124 getline(infile, line);
126 line.size() >= 2 && line[0] ==
static_cast<char>(0xff) &&
127 line[1] ==
static_cast<char>(0xfe))
146 while(std::getline(infile2, wline))
152 line.size() >= 3 && line[0] ==
static_cast<char>(0xef) &&
153 line[1] ==
static_cast<char>(0xbb) && line[2] ==
static_cast<char>(0xbf))
159 while(getline(infile, line))
166 while(getline(infile, line))
184 std::vector<std::string> arguments;
186 bool in_quotes =
false;
187 for(std::size_t i = 0; i < line.size(); i++)
191 if(ch ==
' ' && !in_quotes)
194 arguments.push_back(option);
199 in_quotes = !in_quotes;
206 arguments.push_back(option);
221 std::cout <<
"Warning: uninterpreted non-LINK option '" << s <<
"'\n";
230 "ASSEMBLYLINKRESOURCE",
235 "CLRLOADEROPTIMIZATION",
236 "CLRSUPPORTLASTERROR",
237 "CLRTHREADATTRIBUTE",
238 "CLRUNMANAGEDCODECHECK",
275 "MANIFESTDEPENDENCY",
320 std::string result = s;
321 transform(result.begin(), result.end(), result.begin(), toupper);
330 if(s[0] !=
'/' && s[0] !=
'-')
340 to_upper_string(std::string(s, 1, std::string::npos)) == ms_link_option ||
341 to_upper_string(std::string(s, 1, ms_link_option.size() + 1)) == ms_link_option +
':')
345 if(!optnr.has_value())
357 if(s.size() > ms_link_option.size() + 1)
358 options[*optnr].values.push_back(
359 std::string(s, ms_link_option.size() + 2, std::string::npos));
366 std::cout <<
"Warning: uninterpreted LINK option '" << s <<
"'\n";
optionalt< std::size_t > getoptnr(char option) const
std::vector< optiont > options
void set(const std::string &opt, const char *value) override
Set option option to value.
virtual bool parse(int argc, const char **argv, const char *optstring)
Parses a commandline according to a specification given in optstring.
void process_non_link_option(const std::string &s)
void process_response_file_line(const std::string &line)
void process_response_file(const std::string &file)
void process_link_option(const std::string &s)
static std::string binary(const constant_exprt &src)
const char * ms_link_options[]
static std::string to_upper_string(const std::string &s)
static std::istream & my_wgetline(std::istream &in, std::wstring &dest)
const char * non_ms_link_options[]
parses the command line options into a cmdlinet
A special command line object for LINK options.
output_type narrow(input_type input)
Run-time checked narrowing cast.
nonstd::optional< T > optionalt