XcodeSchemaProperty-check.cmake 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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("DISABLE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION" "enableGPUValidationMode")
  30. check_property("ENABLE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION" "enableGPUShaderValidationMode")
  31. check_property("MALLOC_SCRIBBLE" "MallocScribble")
  32. check_property("MALLOC_GUARD_EDGES" "MallocGuardEdges")
  33. check_property("GUARD_MALLOC" "DYLD_INSERT_LIBRARIES")
  34. check_property("ZOMBIE_OBJECTS" "NSZombieEnabled")
  35. check_property("MALLOC_STACK" "MallocStackLogging")
  36. check_property("DYNAMIC_LINKER_API_USAGE" "DYLD_PRINT_APIS")
  37. check_property("DYNAMIC_LIBRARY_LOADS" "DYLD_PRINT_LIBRARIES")
  38. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_1" "enableGPUFrameCaptureMode=\"1\"")
  39. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_3" "enableGPUFrameCaptureMode=\"3\"")
  40. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED" "enableGPUFrameCaptureMode=\"3\"")
  41. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_METAL" "enableGPUFrameCaptureMode=\"1\"")
  42. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED_MIXED_CASE" "enableGPUFrameCaptureMode=\"3\"")
  43. check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_METAL_MIXED_CASE" "enableGPUFrameCaptureMode=\"1\"")
  44. check_property("LAUNCH_MODE_AUTO" "launchStyle=\"0\"")
  45. check_property("LAUNCH_MODE_WAIT" "launchStyle=\"1\"")
  46. check_property("EXECUTABLE" "myExecutable")
  47. check_property("ARGUMENTS" [=["--foo"]=])
  48. check_property("ARGUMENTS" [=["--bar=baz"]=])
  49. check_property("ENVIRONMENT" [=[key="FOO"]=])
  50. check_property("ENVIRONMENT" [=[value="foo"]=])
  51. check_property("ENVIRONMENT" [=[key="BAR"]=])
  52. check_property("ENVIRONMENT" [=[value="bar"]=])
  53. check_property("WORKING_DIRECTORY" [=["/working/dir"]=])
  54. expect_no_schema("NoSchema")
  55. expect_schema("CustomTarget")
  56. expect_schema("ALL_BUILD")