codegen_options.cpp 806 B

12345678910111213141516171819202122232425262728
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "toolchain/driver/codegen_options.h"
  5. namespace Carbon {
  6. auto CodegenOptions::Build(CommandLine::CommandBuilder& b) -> void {
  7. b.AddStringOption(
  8. {
  9. .name = "target",
  10. .help = R"""(
  11. Select a target platform. Uses the LLVM target syntax. Also known as a "triple"
  12. for historical reasons.
  13. This corresponds to the `target` flag to Clang and accepts the same strings
  14. documented there:
  15. https://clang.llvm.org/docs/CrossCompilation.html#target-triple
  16. )""",
  17. },
  18. [&](auto& arg_b) {
  19. arg_b.Default(host);
  20. arg_b.Set(&target);
  21. });
  22. }
  23. } // namespace Carbon