Skip to content

Commit dcdc798

Browse files
committed
[macOS] Resolve cyclic dependency of stdint.h
Similar to ctype.h, this is also caused by the large std module that wraps all submodules. Instead of removing, it seems sufficient to mark the header as textual. (cherry picked from commit 0f5bfad)
1 parent 423d8c4 commit dcdc798

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

cmake/scripts/std_modulemap_darwin_fix.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
import subprocess
55
import sys
66

7-
def remove_ctype_module(content):
8-
# Break cyclic module dependencies
9-
# See: https://github.com/root-project/root/commit/8045591a17125b49c1007787c586868dea764479
10-
pattern = re.compile(r"module\s+std_ctype_h\s+\[system\]\s*\{.*?\}", re.DOTALL)
11-
return pattern.sub("", content)
7+
def resolve_cyclic_module_dependencies(content):
8+
for h in ["ctype.h", "stdint.h"]:
9+
content = re.sub(f' header "{h}"', f' textual header "{h}"', content)
10+
return content
1211

1312

1413
def main():
@@ -31,7 +30,7 @@ def main():
3130
with open(cpp_modulemap, "r") as f:
3231
original_content = f.read()
3332

34-
cleaned_content = remove_ctype_module(original_content)
33+
cleaned_content = resolve_cyclic_module_dependencies(original_content)
3534

3635
os.makedirs(os.path.dirname(output_path), exist_ok=True)
3736
with open(output_path, "w") as f:

0 commit comments

Comments
 (0)