XcodeSchemaProperty-check.cmake 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. function(check_property property matcher)
  2. set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${property}.xcscheme")
  3. file(STRINGS ${schema} actual-${property}
  4. REGEX "${matcher}" LIMIT_COUNT 1)
  5. if(NOT actual-${property})
  6. message(SEND_ERROR "Xcode schema property ${property}: Could not find ${matcher} in schema ${schema}")
  7. endif()
  8. endfunction()
  9. function(expect_schema target)
  10. set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${target}.xcscheme")
  11. if(NOT EXISTS ${schema})
  12. message(SEND_ERROR "Missing schema for target ${target}")
  13. endif()
  14. endfunction()
  15. function(expect_no_schema target)
  16. set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${target}.xcscheme")
  17. if(EXISTS ${schema})
  18. message(SEND_ERROR "Found unexpected schema ${schema}")
  19. endif()
  20. endfunction()
  21. check_property("ADDRESS_SANITIZER" "enableAddressSanitizer")
  22. check_property("ADDRESS_SANITIZER_USE_AFTER_RETURN" "enableASanStackUseAfterReturn")
  23. check_property("THREAD_SANITIZER" "enableThreadSanitizer")
  24. check_property("THREAD_SANITIZER_STOP" "stopOnEveryThreadSanitizerIssue")
  25. check_property("UNDEFINED_BEHAVIOUR_SANITIZER" "enableUBSanitizer")
  26. check_property("UNDEFINED_BEHAVIOUR_SANITIZER_STOP" "stopOnEveryUBSanitizerIssue")
  27. check_property("DISABLE_MAIN_THREAD_CHECKER" "disableMainThreadChecker")
  28. check_property("MAIN_THREAD_CHECKER_STOP" "stopOnEveryMainThreadCheckerIssue")
  29. check_property("MALLOC_SCRIBBLE" "MallocScribble")
  30. check_property("MALLOC_GUARD_EDGES" "MallocGuardEdges")
  31. check_property("GUARD_MALLOC" "DYLD_INSERT_LIBRARIES")
  32. check_property("ZOMBIE_OBJECTS" "NSZombieEnabled")
  33. check_property("MALLOC_STACK" "MallocStackLogging")
  34. check_property("DYNAMIC_LINKER_API_USAGE" "DYLD_PRINT_APIS")
  35. check_property("DYNAMIC_LIBRARY_LOADS" "DYLD_PRINT_LIBRARIES")
  36. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_1" "enableGPUFrameCaptureMode=\"1\"")
  37. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_3" "enableGPUFrameCaptureMode=\"3\"")
  38. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED" "enableGPUFrameCaptureMode=\"3\"")
  39. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_METAL" "enableGPUFrameCaptureMode=\"1\"")
  40. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED_MIXED_CASE" "enableGPUFrameCaptureMode=\"3\"")
  41. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_METAL_MIXED_CASE" "enableGPUFrameCaptureMode=\"1\"")
  42. check_property("EXECUTABLE" "myExecutable")
  43. check_property("ARGUMENTS" [=["--foo"]=])
  44. check_property("ARGUMENTS" [=["--bar=baz"]=])
  45. check_property("ENVIRONMENT" [=[key="FOO"]=])
  46. check_property("ENVIRONMENT" [=[value="foo"]=])
  47. check_property("ENVIRONMENT" [=[key="BAR"]=])
  48. check_property("ENVIRONMENT" [=[value="bar"]=])
  49. check_property("WORKING_DIRECTORY" [=["/working/dir"]=])
  50. expect_no_schema("NoSchema")
  51. expect_schema("CustomTarget")
  52. expect_schema("ALL_BUILD")