@@ -24,6 +24,16 @@ if (config_use_interactive_mode) {
24
24
25
25
assert (chip_build_tools )
26
26
27
+ declare_args () {
28
+ chip_codesign = current_os == " ios"
29
+ }
30
+
31
+ if (current_os == " ios" ) {
32
+ output_sdk_type = " Debug-iphoneos"
33
+ } else {
34
+ output_sdk_type = " Debug"
35
+ }
36
+
27
37
action (" build-darwin-framework" ) {
28
38
script = " ${ chip_root } /scripts/build/build_darwin_framework.py"
29
39
@@ -47,7 +57,7 @@ action("build-darwin-framework") {
47
57
48
58
output_name = " Matter.framework"
49
59
outputs = [
50
- " ${ root_out_dir } /macos_framework_output/Build/Products/Debug /${ output_name } " ,
60
+ " ${ root_out_dir } /macos_framework_output/Build/Products/${ output_sdk_type } /${ output_name } " ,
51
61
" ${ root_build_dir } /darwin_framework_build.log" ,
52
62
" ${ root_out_dir } /macos_framework_output/ModuleCache.noindex/" ,
53
63
" ${ root_out_dir } /macos_framework_output/Logs" ,
@@ -64,11 +74,12 @@ config("config") {
64
74
" ${ chip_root } /zzz_generated/controller-clusters" ,
65
75
" ${ chip_root } /examples/chip-tool" ,
66
76
" ${ chip_root } /zzz_generated/chip-tool" ,
67
- " ${ root_out_dir } /macos_framework_output/Build/Products/Debug /" ,
77
+ " ${ root_out_dir } /macos_framework_output/Build/Products/${ output_sdk_type } /" ,
68
78
]
69
79
70
- framework_dirs =
71
- [ " ${ root_out_dir } /macos_framework_output/Build/Products/Debug/" ]
80
+ framework_dirs = [
81
+ " ${ root_out_dir } /macos_framework_output/Build/Products/${ output_sdk_type } /" ,
82
+ ]
72
83
73
84
defines = [
74
85
" CONFIG_ENABLE_YAML_TESTS=${ config_enable_yaml_tests } " ,
@@ -139,7 +150,7 @@ executable("darwin-framework-tool") {
139
150
140
151
ldflags = [
141
152
" -rpath" ,
142
- " @executable_path/macos_framework_output/Build/Products/Debug /" ,
153
+ " @executable_path/macos_framework_output/Build/Products/${ output_sdk_type } /" ,
143
154
]
144
155
145
156
frameworks = [
@@ -151,3 +162,20 @@ executable("darwin-framework-tool") {
151
162
152
163
output_dir = root_out_dir
153
164
}
165
+
166
+ if (chip_codesign ) {
167
+ action (" codesign" ) {
168
+ script = " entitlements/codesign.py"
169
+ public_deps = [ " :darwin-framework-tool" ]
170
+
171
+ args = [
172
+ " --target_path" ,
173
+ rebase_path (" ${ root_build_dir } /darwin-framework-tool" , root_build_dir ),
174
+ " --log_path" ,
175
+ rebase_path (" ${ root_build_dir } /codesign_log.txt" , root_build_dir ),
176
+ ]
177
+
178
+ output_name = " codesign_log.txt"
179
+ outputs = [ " ${ root_build_dir } /${ output_name } " ]
180
+ }
181
+ }
0 commit comments