WindresOpts.td 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. include "llvm/Option/OptParser.td"
  2. multiclass Long<string name, string help> {
  3. def NAME: Separate<["--"], name>;
  4. def NAME # _eq: Joined<["--"], name # "=">, Alias<!cast<Separate>(NAME)>,
  5. HelpText<help>;
  6. }
  7. multiclass LongAlias<string name, Option orig> {
  8. def NAME: Separate<["--"], name>, Alias<orig>;
  9. def NAME # _eq: Joined<["--"], name # "=">, Alias<orig>;
  10. }
  11. multiclass LongShort<string short, string long, string help> {
  12. def NAME: Separate<["--"], long>;
  13. def NAME # _eq: Joined<["--"], long # "=">, Alias<!cast<Separate>(NAME)>,
  14. HelpText<help>;
  15. def NAME # _short: JoinedOrSeparate<["-"], short>, Alias<!cast<Separate>(NAME)>;
  16. }
  17. multiclass F<string short, string long, string help> {
  18. def NAME: Flag<["-"], short>;
  19. def NAME # _long: Flag<["--"], long>, Alias<!cast<Flag>(NAME)>,
  20. HelpText<help>;
  21. }
  22. defm input : LongShort<"i", "input", "Input file">;
  23. defm output : LongShort<"o", "output", "Output file">;
  24. defm input_format : LongShort<"J", "input-format", "Input format">;
  25. defm output_format : LongShort<"O", "output-format", "Output format">;
  26. defm preprocessor : Long<"preprocessor", "Custom preprocessor command">;
  27. defm preprocessor_arg : Long<"preprocessor-arg", "Preprocessor command argument">;
  28. defm target : LongShort<"F", "target", "Target BFD format name">;
  29. defm include_dir : LongShort<"I", "include-dir", "Include directory">;
  30. defm include_alias : LongAlias<"include", include_dir>;
  31. defm define : LongShort<"D", "define", "Define to pass to the preprocessor">;
  32. defm undef : LongShort<"U", "undefine", "Undefine to pass to the preprocessor">;
  33. defm codepage : LongShort<"c", "codepage", "Default codepage to use">;
  34. defm language : LongShort<"l", "language", "Default language to use (0x0-0xffff)">;
  35. defm verbose : F<"v", "verbose", "Enable verbose output">;
  36. defm version : F<"V", "version", "Display version">;
  37. defm help : F<"h", "help", "Display this message and exit">;
  38. // Print (but do not run) the commands to run for preprocessing
  39. def _HASH_HASH_HASH : Flag<["-"], "###">;
  40. def no_preprocess : Flag<["--"], "no-preprocess">;
  41. // Unimplemented options for compatibility
  42. def use_temp_file: Flag<["--"], "use-temp-file">;