Skip to content

Commit 012589d

Browse files
committed
[interop] test - check if CF_OPTIONS is up to date with interop changes in embedded SDK too
1 parent be0f25d commit 012589d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/Interop/lit.local.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ if config.variant_sdk and config.variant_sdk != "":
1919

2020
# Check if CF_OPTIONS macro has been updated to be imported into Swift in C++ mode correctly.
2121
cf_avail_path = os.path.join(config.variant_sdk, 'System', 'Library', 'Frameworks', 'CoreFoundation.framework', 'Versions', 'A', 'Headers', 'CFAvailability.h')
22-
if os.path.exists(cf_avail_path):
23-
with open(cf_avail_path, 'r') as file:
22+
cf_avail_path_embedded = os.path.join(config.variant_sdk, 'System', 'Library', 'Frameworks', 'CoreFoundation.framework', 'Headers', 'CFAvailability.h')
23+
if os.path.exists(cf_avail_path) or os.path.exists(cf_avail_path_embedded):
24+
cf_avail_path_use = cf_avail_path if os.path.exists(cf_avail_path) else cf_avail_path_embedded
25+
with open(cf_avail_path_use, 'r') as file:
2426
contents = file.read()
2527
import re
2628
regex = r'^#define CF_OPTIONS\(_type, _name\) _type _name; enum __CF_OPTIONS_ATTRIBUTES'

0 commit comments

Comments
 (0)