CheckISPCSourceCompiles.cmake 387 B

1234567891011121314151617181920
  1. enable_language (ISPC)
  2. include(CheckSourceCompiles)
  3. check_source_compiles(ISPC "I don't build" SHOULD_FAIL)
  4. if(SHOULD_FAIL)
  5. message(SEND_ERROR "invalid ISPC source didn't fail.")
  6. endif()
  7. check_source_compiles(ISPC [=[
  8. float func(uniform int32, float a)
  9. {
  10. return a / 2.25;
  11. }
  12. ]=]
  13. SHOULD_BUILD)
  14. if(NOT SHOULD_BUILD)
  15. message(SEND_ERROR "Test fail for valid ISPC source.")
  16. endif()