unitybuild_cuda_group-check.cmake 1.1 KB

123456789101112131415161718192021222324252627
  1. set(unitybuild_a_cu "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_a_cu.cu")
  2. if(NOT EXISTS "${unitybuild_a_cu}")
  3. set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_a_cu} does not exist.")
  4. return()
  5. else()
  6. #verify that odr2 is not part of this source set
  7. file(STRINGS ${unitybuild_a_cu} unitybuild_a_cu_strings)
  8. string(REGEX MATCH ".*#include.*odr2.cu" matched_code ${unitybuild_a_cu_strings})
  9. if(matched_code)
  10. set(RunCMake_TEST_FAILED "Generated unity file includes un-expected ord2.cu source file")
  11. return()
  12. endif()
  13. endif()
  14. set(unitybuild_b_cu "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_b_cu.cu")
  15. if(NOT EXISTS "${unitybuild_b_cu}")
  16. set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_b_cu} does not exist.")
  17. return()
  18. else()
  19. #verify that odr1 is not part of this source set
  20. file(STRINGS ${unitybuild_b_cu} unitybuild_b_cu_strings)
  21. string(REGEX MATCH ".*#include.*odr1.cu" matched_code ${unitybuild_b_cu_strings})
  22. if(matched_code)
  23. set(RunCMake_TEST_FAILED "Generated unity file includes un-expected ord1.cu source file")
  24. return()
  25. endif()
  26. endif()