Skip to content

Commit

Permalink
Create build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
prikolium-cfx authored May 1, 2024
1 parent 76fa79e commit be8272b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions build/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Turn off echo and set error preference to continue on error
$ErrorActionPreference = 'Continue'

# Define environment variables
$env:GN_DEFINES = "is_chrome_branded=false symbol_level=1 is_official_build=true use_thin_lto=false proprietary_codecs=true ffmpeg_branding=Chrome enable_widevine=true"
$env:GYP_MSVS_VERSION = "2022"

# Get the current directory of the script
$CURRENT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Path

# Attempt to remove X: mapping; ignore errors
Remove-PSDrive -Name "X" -ErrorAction SilentlyContinue

# Map X: to the current directory's parent
New-PSDrive -Name "X" -PSProvider FileSystem -Root "${CURRENT_DIR}\.." -ErrorAction SilentlyContinue

# Define more variables using the new drive mapping
$DOWNLOAD_DIR = "X:\chromium_git"
$DEPOT_TOOLS_DIR = "X:\depot_tools"

# Execute the build using dynamic paths
& python "X:\build\automate-git.py" `
--url="https://github.com/citizenfx/cef.git" `
--checkout="cfx-m124" `
--download-dir="$DOWNLOAD_DIR" `
--depot-tools-dir="$DEPOT_TOOLS_DIR" `
--x64-build `
--no-cef-update `
--no-depot-tools-update `
--with-pgo-profiles $args

# Attempt to clean up and remove X: mapping at the end; ignore errors
Remove-PSDrive -Name "X" -ErrorAction SilentlyContinue

0 comments on commit be8272b

Please sign in to comment.