CheckCSourceRuns.cmake 368 B

12345678910111213
  1. enable_language (C)
  2. include(CheckSourceRuns)
  3. check_source_runs(C "int main() {return 2;}" SHOULD_FAIL)
  4. if(SHOULD_FAIL)
  5. message(SEND_ERROR "C check_source_runs succeeded, but should have failed.")
  6. endif()
  7. check_source_runs(C "int main() {return 0;}" SHOULD_RUN)
  8. if(NOT SHOULD_RUN)
  9. message(SEND_ERROR "C check_source_runs failed for valid C executable.")
  10. endif()