-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from wasmerio/use-official-v8
Use upstream V8 with patches
- Loading branch information
Showing
6 changed files
with
820 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
$V8_REPO_URL = $args[1] | ||
$DEPOT_TOOLS_REPO="https://chromium.googlesource.com/chromium/tools/depot_tools.git" | ||
|
||
if ([string]::IsNullOrEmpty($V8_REPO_URL)) { | ||
$V8_REPO_URL = "https://github.com/laper32/v8-cmake.git" | ||
# Clone depot-tools | ||
if (-not (Test-Path -Path "depot_tools" -PathType Container)) { | ||
git clone --single-branch --depth=1 "$DEPOT_TOOLS_REPO" "C:\tmp\depot_tools" | ||
} | ||
|
||
# Clone the LLVM project. | ||
if (-not (Test-Path -Path "v8-cmake" -PathType Container)) { | ||
git clone -b "msvc" --single-branch --depth=1 "$V8_REPO_URL" v8-cmake | ||
} | ||
|
||
Set-Location v8-cmake | ||
git fetch origin | ||
echo "C:\tmp\depot_tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
$env:Path = "C:\tmp\depot_tools;" + $env:Path | ||
|
||
# Create a directory to build the project. | ||
New-Item -Path "build" -Force -ItemType "directory" | ||
Set-Location build | ||
# Set up google's client and fetch v8 | ||
if (-not (Test-Path -Path "v8" -PathType Container)) { | ||
gclient | ||
fetch v8 | ||
} | ||
|
||
# Create a directory to receive the complete installation. | ||
New-Item -Path "install" -Force -ItemType "directory" | ||
Set-Location v8 | ||
|
||
# Adjust compilation based on the OS. | ||
$CMAKE_ARGUMENTS = "" | ||
git checkout $V8_COMMIT | ||
|
||
# Adjust cross compilation | ||
$CROSS_COMPILE = "" | ||
# Apply patches | ||
|
||
# Run `cmake` to configure the project, using MSVC. | ||
$CMAKE_CXX_COMPILER="cl.exe" | ||
$CMAKE_C_COMPILER="cl.exe" | ||
$CMAKE_LINKER_TYPE="MSVC" | ||
$files = Get-ChildItem "../patches" -Filter *.patch | ||
foreach ($f in $files){ | ||
git apply $f | ||
} | ||
|
||
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=MinSizeRel .. | ||
gn gen out/release --args="is_debug=false v8_symbol_level=2 is_component_build=false is_official_build=false use_custom_libcxx=false use_custom_libcxx_for_host=true use_sysroot=false use_glib=false is_clang=false v8_expose_symbols=true v8_optimized_debug=false v8_enable_sandbox=false v8_enable_i18n_support=false v8_enable_gdbjit=false v8_use_external_startup_data=false | ||
treat_warnings_as_errors=false target_cpu=\"$ARCH\" v8_target_cpu=\"$ARCH\" target_os=\"$OS\"" | ||
|
||
# Showtime! | ||
cmake --build . --config MinSizeRel --target wee8 | ||
ninja -C out/release wee8 | ||
|
||
ls -laR out/release/obj |
Oops, something went wrong.