Lagom: Move Mac SDK header patch stamp file creation into script

No behavior change.
This commit is contained in:
Nico Weber
2026-04-15 16:18:10 -04:00
parent 900b879147
commit d434c94018
2 changed files with 6 additions and 2 deletions

View File

@@ -23,8 +23,7 @@ if (APPLE)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/patched_mac_headers/stamp"
COMMAND "${Python3_EXECUTABLE}" "${SerenityOS_SOURCE_DIR}/Meta/Lagom/Tools/patch_mac_sdk_headers_for_cxx26.py" -o "${CMAKE_BINARY_DIR}/patched_mac_headers" --sdk-path "${CMAKE_OSX_SYSROOT}"
COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_BINARY_DIR}/patched_mac_headers/stamp"
COMMAND "${Python3_EXECUTABLE}" "${SerenityOS_SOURCE_DIR}/Meta/Lagom/Tools/patch_mac_sdk_headers_for_cxx26.py" -o "${CMAKE_BINARY_DIR}/patched_mac_headers" --sdk-path "${CMAKE_OSX_SYSROOT}" --stamp "${CMAKE_BINARY_DIR}/patched_mac_headers/stamp"
VERBATIM
DEPENDS "${SerenityOS_SOURCE_DIR}/Meta/Lagom/Tools/patch_mac_sdk_headers_for_cxx26.py"
)

View File

@@ -11,6 +11,7 @@
import argparse
import os
import pathlib
import subprocess
@@ -28,6 +29,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('--sdk-path', help='Path to Mac SDK', required=True)
parser.add_argument('-o', '--output-dir', help='Output path for the patched header files', required=True)
parser.add_argument('--stamp', help='File to touch at end')
args = parser.parse_args()
sdk_path = args.sdk_path
@@ -49,6 +51,9 @@ def main():
with open(output_path, "w") as f:
f.write(content)
if args.stamp:
pathlib.Path(args.stamp).touch()
if __name__ == '__main__':
main()