#include <string>
#include <map>
enum class toolchain
{
GNU, // GCC+GNU binutils
Microsoft, // cl.exe and link.exe
LLVM, // Clang+GNU binutils (may change later)
Intel // ICC+platform linker
// ...
} ;
enum class generator_string
{
compiler, // compiler program name (without target prefixes)
linker, // linker program name
output_argument, // precedes output file name
compile_argument, // compile to object file
} ;
typedef std:: map < toolchain, std:: map < generator_string, std:: string > > generator_map;
const generator_map cgenerator_map =
{ { toolchain:: GNU ,
{ { generator_string:: compiler , "gcc" } ,
{ generator_string:: linker , "gcc" } ,
{ generator_string:: output_argument , "-o" } ,
{ generator_string:: compile_argument , "-c" } } } ,
{ toolchain:: Microsoft ,
{ { generator_string:: compiler , "cl" } ,
{ generator_string:: linker , "link" } ,
{ generator_string:: output_argument , "" } ,
{ generator_string:: compile_argument , "/c" } } } ,
{ toolchain:: LLVM ,
{ { generator_string:: compiler , "clang++" } } } ,
{ toolchain:: Intel ,
{ { generator_string:: compiler , "icc" } } } } ;
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPG1hcD4KCmVudW0gY2xhc3MgdG9vbGNoYWluCnsKICAgIEdOVSwgLy8gR0NDK0dOVSBiaW51dGlscwogICAgTWljcm9zb2Z0LCAvLyBjbC5leGUgYW5kIGxpbmsuZXhlCiAgICBMTFZNLCAvLyBDbGFuZytHTlUgYmludXRpbHMgKG1heSBjaGFuZ2UgbGF0ZXIpCiAgICBJbnRlbCAvLyBJQ0MrcGxhdGZvcm0gbGlua2VyCiAgICAvLyAuLi4KfTsKCmVudW0gY2xhc3MgZ2VuZXJhdG9yX3N0cmluZwp7CiAgICBjb21waWxlciwgLy8gY29tcGlsZXIgcHJvZ3JhbSBuYW1lICh3aXRob3V0IHRhcmdldCBwcmVmaXhlcykKICAgIGxpbmtlciwgLy8gbGlua2VyIHByb2dyYW0gbmFtZQogICAgb3V0cHV0X2FyZ3VtZW50LCAvLyBwcmVjZWRlcyBvdXRwdXQgZmlsZSBuYW1lCiAgICBjb21waWxlX2FyZ3VtZW50LCAvLyBjb21waWxlIHRvIG9iamVjdCBmaWxlCn07Cgp0eXBlZGVmIHN0ZDo6bWFwPHRvb2xjaGFpbiwgc3RkOjptYXA8Z2VuZXJhdG9yX3N0cmluZywgc3RkOjpzdHJpbmc+ID4gZ2VuZXJhdG9yX21hcDsKCmNvbnN0IGdlbmVyYXRvcl9tYXAgY2dlbmVyYXRvcl9tYXAgPQogICAgICAgICB7IHsgdG9vbGNoYWluOjpHTlUsCiAgICAgICAgICAgICB7IHtnZW5lcmF0b3Jfc3RyaW5nOjpjb21waWxlciwgICAgICAgICAgImdjYyJ9LAogICAgICAgICAgICAgICB7Z2VuZXJhdG9yX3N0cmluZzo6bGlua2VyLCAgICAgICAgICAgICJnY2MifSwKICAgICAgICAgICAgICAge2dlbmVyYXRvcl9zdHJpbmc6Om91dHB1dF9hcmd1bWVudCwgICAiLW8ifSwKICAgICAgICAgICAgICAge2dlbmVyYXRvcl9zdHJpbmc6OmNvbXBpbGVfYXJndW1lbnQsICAiLWMifSB9IH0sCiAgICAgICAgICAgeyB0b29sY2hhaW46Ok1pY3Jvc29mdCwKICAgICAgICAgICAgIHsge2dlbmVyYXRvcl9zdHJpbmc6OmNvbXBpbGVyLCAgICAgICAgICJjbCJ9LAogICAgICAgICAgICAgICB7Z2VuZXJhdG9yX3N0cmluZzo6bGlua2VyLCAgICAgICAgICAgImxpbmsifSwKICAgICAgICAgICAgICAge2dlbmVyYXRvcl9zdHJpbmc6Om91dHB1dF9hcmd1bWVudCwgICIifSwKICAgICAgICAgICAgICAge2dlbmVyYXRvcl9zdHJpbmc6OmNvbXBpbGVfYXJndW1lbnQsICIvYyJ9IH0gfSwKICAgICAgICAgICB7IHRvb2xjaGFpbjo6TExWTSwKICAgICAgICAgICAgIHsge2dlbmVyYXRvcl9zdHJpbmc6OmNvbXBpbGVyLCAgICAgICAgICJjbGFuZysrIn0gfSB9LAogICAgICAgICAgIHsgdG9vbGNoYWluOjpJbnRlbCwKICAgICAgICAgICAgIHsge2dlbmVyYXRvcl9zdHJpbmc6OmNvbXBpbGVyLCAgICAgICAgICJpY2MifSB9IH0gfTsK