ninja-check.cmake 703 B

1234567891011121314151617181920
  1. file(READ build.ninja build_ninja)
  2. if("${build_ninja}" MATCHES [====[
  3. # Unknown Build Time Dependencies.
  4. # Tell Ninja that they may appear as side effects of build rules
  5. # otherwise ordered by order-only dependencies.
  6. ((build [^:]*: phony[^\n]*
  7. )*)# ========]====])
  8. set(phony "${CMAKE_MATCH_1}")
  9. if(NOT phony)
  10. message(STATUS "build.ninja correctly does not have extra phony rules")
  11. else()
  12. string(REGEX REPLACE "\n+$" "" phony "${phony}")
  13. string(REGEX REPLACE "\n" "\n " phony " ${phony}")
  14. message(FATAL_ERROR "build.ninja incorrectly has extra phony rules:\n"
  15. "${phony}")
  16. endif()
  17. else()
  18. message(FATAL_ERROR "build.ninja is incorrectly missing expected block")
  19. endif()