Fix local build
This commit is contained in:
parent
ab57df147a
commit
c223aed812
@ -1,28 +0,0 @@
|
||||
Set-StrictMode -Version Latest
|
||||
Set-PSDebug -Trace 2
|
||||
|
||||
$LLVM_VERSION="19.1.2"
|
||||
$BASE_DOWNLOAD_URL="https://github.com/birth-software/build-llvm/releases/download/llvm-$LLVM_VERSION"
|
||||
|
||||
$LLVM_DOWNLOAD_FILE_BASENAME="llvm-$LLVM_VERSION-windows-amd64-msvc17-msvcrt"
|
||||
if ($args[0].Equals("Debug"))
|
||||
{
|
||||
$LLVM_DOWNLOAD_FILE_BASENAME="$LLVM_DOWNLOAD_FILE_BASENAME-dbg"
|
||||
}
|
||||
|
||||
$LLVM_DOWNLOAD_FILE="$LLVM_DOWNLOAD_FILE_BASENAME.7z"
|
||||
$LLVM_DOWNLOAD_URL="$BASE_DOWNLOAD_URL/$LLVM_DOWNLOAD_FILE"
|
||||
|
||||
Write-Output "URL: $LLVM_DOWNLOAD_URL"
|
||||
|
||||
Invoke-WebRequest -Uri "$LLVM_DOWNLOAD_URL" -OutFile "$LLVM_DOWNLOAD_FILE"
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
exit $LastExitCode
|
||||
}
|
||||
7z x $LLVM_DOWNLOAD_FILE
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
exit $LastExitCode
|
||||
}
|
||||
dir
|
70
project.ps1
70
project.ps1
@ -1,70 +0,0 @@
|
||||
Set-StrictMode -Version Latest
|
||||
Set-PSDebug -Trace 2
|
||||
$previous_error_action_preference = $global:ErrorActionPreference
|
||||
$global:ErrorActionPreference = 'Stop'
|
||||
$myargs=$args
|
||||
$build_dir="build"
|
||||
$release_mode="Debug"
|
||||
$build_type_prefix="build_type="
|
||||
$cmake_prefix_path_prefix="-DCMAKE_PREFIX_PATH="
|
||||
|
||||
try
|
||||
{
|
||||
$cmake_prefix_path=""
|
||||
foreach ($arg in $myargs)
|
||||
{
|
||||
if ($arg.StartsWith($build_type_prefix))
|
||||
{
|
||||
$release_mode = $arg.Substring($build_type_prefix.Length)
|
||||
}
|
||||
if ($arg.StartsWith($cmake_prefix_path_prefix))
|
||||
{
|
||||
$cmake_prefix_path = $arg.Substring($cmake_prefix_path_prefix.Length);
|
||||
}
|
||||
}
|
||||
|
||||
if ($cmake_prefix_path.Equals(""))
|
||||
{
|
||||
if ($release_mode.Equals("Debug"))
|
||||
{
|
||||
$cmake_prefix_path="llvm-19.1.2-windows-amd64-msvc17-msvcrt-dbg"
|
||||
}
|
||||
else
|
||||
{
|
||||
$cmake_prefix_path="llvm-19.1.2-windows-amd64-msvc17-msvcrt"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output "Build type: $release_mode. Prefix $cmake_prefix_path"
|
||||
|
||||
New-Item -Path $build_dir -ItemType Directory -Force
|
||||
cmake . "-B$build_dir" -G Ninja "-DCMAKE_BUILD_TYPE=$release_mode" -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" "-DCMAKE_PREFIX_PATH=$cmake_prefix_path" "-DCMAKE_VERBOSE_MAKEFILE=ON"
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
exit $LastExitCode
|
||||
}
|
||||
pushd $build_dir
|
||||
ninja -v
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
exit $LastExitCode
|
||||
}
|
||||
popd
|
||||
|
||||
if ($($myargs.Length) -ne 0)
|
||||
{
|
||||
& ".\$build_dir\runner" $myargs
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
exit $LastExitCode
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw
|
||||
}
|
||||
finally
|
||||
{
|
||||
$global:ErrorActionPreference = $previous_error_action_preference
|
||||
}
|
43
project.sh
43
project.sh
@ -1,11 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
set -eux
|
||||
original_dir=$PWD
|
||||
build_dir=build
|
||||
C_COMPILER_PATH=clang
|
||||
CXX_COMPILER_PATH=clang++
|
||||
ASM_COMPILER_PATH=clang
|
||||
|
||||
if [[ -z "${BIRTH_OS-}" ]]; then
|
||||
case "$OSTYPE" in
|
||||
msys*)
|
||||
BIRTH_OS=windows
|
||||
;;
|
||||
linux*)
|
||||
BIRTH_OS=linux
|
||||
;;
|
||||
darwin*)
|
||||
BIRTH_OS=macos
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ -z "${BIRTH_ARCH-}" ]]; then
|
||||
case "$(uname -m)" in
|
||||
x86_64)
|
||||
BIRTH_ARCH=x86_64
|
||||
;;
|
||||
arm64)
|
||||
BIRTH_ARCH=aarch64
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ -z "${CMAKE_BUILD_TYPE-}" ]]; then
|
||||
CMAKE_BUILD_TYPE=Debug
|
||||
fi
|
||||
|
||||
if [[ -z "${CMAKE_PREFIX_PATH-}" ]]; then
|
||||
CMAKE_PREFIX_PATH=""
|
||||
fi
|
||||
|
||||
|
||||
|
||||
case $BIRTH_OS in
|
||||
windows)
|
||||
C_COMPILER_OPT_ARG="-DCMAKE_C_COMPILER_TARGET=x86_64-pc-windows-msvc"
|
||||
|
Loading…
x
Reference in New Issue
Block a user