CMP0158.rst 1.2 KB

12345678910111213141516171819202122232425262728
  1. CMP0158
  2. -------
  3. .. versionadded:: 3.29
  4. :command:`add_test` honors :variable:`CMAKE_CROSSCOMPILING_EMULATOR` only
  5. when :variable:`cross-compiling <CMAKE_CROSSCOMPILING>`.
  6. In CMake 3.28 and below, :command:`add_test` unconditionally used the
  7. :prop_tgt:`CROSSCOMPILING_EMULATOR` target property (initialized by the
  8. :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable) to run test commands
  9. naming executable targets. CMake 3.29 and above prefer to use the emulator
  10. only when the :variable:`CMAKE_CROSSCOMPILING` variable is enabled. The
  11. :variable:`CMAKE_TEST_LAUNCHER` variable may be used instead when not
  12. cross-compiling. This policy provides compatibility for projects that
  13. have not been updated.
  14. The ``OLD`` behavior for this policy is for :command:`add_test` to use
  15. the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property unconditionally.
  16. The ``NEW`` behavior for this policy is for :command:`add_test` to use
  17. the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property only when
  18. :variable:`cross-compiling <CMAKE_CROSSCOMPILING>`.
  19. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
  20. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  21. .. include:: STANDARD_ADVICE.txt
  22. .. include:: DEPRECATED.txt