add_compile_options.rst 618 B

1234567891011121314151617
  1. add_compile_options
  2. -------------------
  3. Adds options to the compilation of source files.
  4. ::
  5. add_compile_options(<option> ...)
  6. Adds options to the compiler command line for sources in the current
  7. directory and below. This command can be used to add any options, but
  8. alternative commands exist to add preprocessor definitions or include
  9. directories. See documentation of the directory and target
  10. COMPILE_OPTIONS properties for details. Arguments to
  11. add_compile_options may use "generator expressions" with the syntax
  12. "$<...>". See the :manual:`cmake-generator-expressions(7)` manual for
  13. available expressions.