File: XcodeSchemaProperty-check.cmake

package info (click to toggle)
cmake 3.18.4-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 95,096 kB
  • sloc: ansic: 326,336; cpp: 218,301; yacc: 3,207; sh: 3,067; python: 2,637; lex: 1,324; asm: 371; lisp: 273; f90: 240; objc: 205; perl: 198; java: 197; xml: 178; cs: 140; fortran: 126; makefile: 84; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (53 lines) | stat: -rw-r--r-- 2,363 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function(check_property property matcher)
  set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${property}.xcscheme")
  file(STRINGS ${schema} actual-${property}
       REGEX "${matcher}" LIMIT_COUNT 1)
  if(NOT actual-${property})
    message(SEND_ERROR "Xcode schema property ${property}: Could not find ${matcher} in schema ${schema}")
  endif()
endfunction()

function(expect_schema target)
  set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${target}.xcscheme")
  if(NOT EXISTS ${schema})
    message(SEND_ERROR "Missing schema for target ${target}")
  endif()
endfunction()

function(expect_no_schema target)
  set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${target}.xcscheme")
  if(EXISTS ${schema})
    message(SEND_ERROR "Found unexpected schema ${schema}")
  endif()
endfunction()

check_property("ADDRESS_SANITIZER" "enableAddressSanitizer")
check_property("ADDRESS_SANITIZER_USE_AFTER_RETURN" "enableASanStackUseAfterReturn")
check_property("THREAD_SANITIZER" "enableThreadSanitizer")
check_property("THREAD_SANITIZER_STOP" "stopOnEveryThreadSanitizerIssue")
check_property("UNDEFINED_BEHAVIOUR_SANITIZER" "enableUBSanitizer")
check_property("UNDEFINED_BEHAVIOUR_SANITIZER_STOP" "stopOnEveryUBSanitizerIssue")
check_property("DISABLE_MAIN_THREAD_CHECKER" "disableMainThreadChecker")
check_property("MAIN_THREAD_CHECKER_STOP" "stopOnEveryMainThreadCheckerIssue")

check_property("MALLOC_SCRIBBLE" "MallocScribble")
check_property("MALLOC_GUARD_EDGES" "MallocGuardEdges")
check_property("GUARD_MALLOC" "DYLD_INSERT_LIBRARIES")
check_property("ZOMBIE_OBJECTS" "NSZombieEnabled")
check_property("MALLOC_STACK" "MallocStackLogging")
check_property("DYNAMIC_LINKER_API_USAGE" "DYLD_PRINT_APIS")
check_property("DYNAMIC_LIBRARY_LOADS" "DYLD_PRINT_LIBRARIES")

check_property("EXECUTABLE" "myExecutable")
check_property("ARGUMENTS" [=["--foo"]=])
check_property("ARGUMENTS" [=["--bar=baz"]=])
check_property("ENVIRONMENT" [=[key="FOO"]=])
check_property("ENVIRONMENT" [=[value="foo"]=])
check_property("ENVIRONMENT" [=[key="BAR"]=])
check_property("ENVIRONMENT" [=[value="bar"]=])
check_property("WORKING_DIRECTORY" [=["/working/dir"]=])

expect_no_schema("NoSchema")

expect_schema("CustomTarget")
expect_schema("ALL_BUILD")