@@ -67,6 +67,29 @@ $replaceWhat = 'MapHandlesSpan(possible_transition_targets.begin(),'
6767$replaceWith = ' possible_transition_targets.empty() ? MapHandlesSpan() : MapHandlesSpan(possible_transition_targets.begin(),'
6868(Get-Content $filePath ).Replace($replaceWhat , $replaceWith ) | Set-Content $filePath
6969
70+ # Fix std::function -> base::FunctionRef incompatibility in backing-store.cc on newer V8/Clang builds
71+ $filePath = " ${MOUNT_TARGET_DRIVE} :\v8\src\objects\backing-store.cc"
72+ $replaceWhat = ' auto gc_retry = [&](const std::function<bool()>& fn) {'
73+ $replaceWith = ' auto gc_retry = [&](base::FunctionRef<bool()> fn) {'
74+ (Get-Content $filePath ).Replace($replaceWhat , $replaceWith ) | Set-Content $filePath
75+
76+ # Increase Clang constexpr step limit for debug iterator builds
77+ $filePath = " ${MOUNT_TARGET_DRIVE} :\v8\build\config\compiler\BUILD.gn"
78+ $replaceWhat = @'
79+ cflags = []
80+ cflags_c = []
81+ cflags_cc = []
82+ '@
83+ $replaceWith = @'
84+ cflags = []
85+ cflags_c = []
86+ cflags_cc = []
87+ if (is_win && is_clang && is_debug) {
88+ cflags_cc += [ "/clang:-fconstexpr-steps=5242880" ]
89+ }
90+ '@
91+ (Get-Content $filePath - Raw).Replace($replaceWhat , $replaceWith ) | Set-Content $filePath
92+
7093# ###################################
7194# #
7295# Tricks and hacks zone end #
@@ -83,5 +106,20 @@ New-Item -ItemType Directory -Force -Path "${MOUNT_TARGET_DRIVE}:\build_results"
83106Copy-Item - Path " ${MOUNT_TARGET_DRIVE} :\v8\out.gn\x64.debug\obj\v8_monolith.lib" - Destination " ${MOUNT_TARGET_DRIVE} :\build_results\v8_monolithd.lib"
84107Copy-Item - Path " ${MOUNT_TARGET_DRIVE} :\v8\out.gn\x64.release\obj\v8_monolith.lib" - Destination " ${MOUNT_TARGET_DRIVE} :\build_results\v8_monolith.lib"
85108
109+ $PACKAGE_ROOT = " ${MOUNT_TARGET_DRIVE} :\build_results\v8-package"
110+ $PACKAGE_LIBS_DIR = " $PACKAGE_ROOT \libs"
111+ $PACKAGE_INCLUDE_DIR = " $PACKAGE_ROOT \include\v8"
112+ $PACKAGE_ARCHIVE = " ${MOUNT_TARGET_DRIVE} :\build_results\v8.tar.xz"
113+
114+ Remove-Item - Path $PACKAGE_ROOT - Recurse - Force - ErrorAction SilentlyContinue
115+ Remove-Item - Path $PACKAGE_ARCHIVE - Force - ErrorAction SilentlyContinue
116+ New-Item - ItemType Directory - Force - Path $PACKAGE_LIBS_DIR
117+ New-Item - ItemType Directory - Force - Path $PACKAGE_INCLUDE_DIR
118+ Copy-Item - Path " ${MOUNT_TARGET_DRIVE} :\build_results\v8_monolithd.lib" - Destination $PACKAGE_LIBS_DIR
119+ Copy-Item - Path " ${MOUNT_TARGET_DRIVE} :\build_results\v8_monolith.lib" - Destination $PACKAGE_LIBS_DIR
120+ Copy-Item - Path " ${MOUNT_TARGET_DRIVE} :\v8\include\*" - Destination $PACKAGE_INCLUDE_DIR - Recurse - Force
121+ tar.exe - cJf $PACKAGE_ARCHIVE - C $PACKAGE_ROOT .
122+ Remove-Item - Path $PACKAGE_ROOT - Recurse - Force
123+
86124# Attempt to clean up and remove X: mapping at the end; ignore errors
87125Invoke-Expression " subst ${MOUNT_TARGET_DRIVE} : /D" - ErrorAction SilentlyContinue
0 commit comments