-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for building ObjWriter (#572)
- Loading branch information
Showing
5 changed files
with
79 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@echo off | ||
setlocal | ||
|
||
:: Clone the LLVM repo | ||
pushd %1 || exit /b 1 | ||
if not exist llvm ( | ||
git clone -b release_50 https://github.com/llvm-mirror/llvm.git || exit /b 1 | ||
) | ||
|
||
:: Clean the tree and apply the patch | ||
cd llvm && git restore . || exit /b 1 | ||
git apply "%~dp0llvm.patch" || exit /b 1 | ||
|
||
:: Copy ObjWriter files | ||
robocopy /mir "%~dp0\" tools\ObjWriter | ||
if %ErrorLevel% geq 8 exit /b %ErrorLevel% | ||
|
||
:: Configure and build | ||
if not exist build mkdir build | ||
cd build || exit /b 1 | ||
|
||
cmake ../ -DCMAKE_BUILD_TYPE=Release -DLLVM_OPTIMIZED_TABLEGEN=1 -DHAVE_POSIX_SPAWN=0 -DLLVM_ENABLE_PIC=1 -DLLVM_BUILD_TESTS=0 -DLLVM_ENABLE_DOXYGEN=0 -DLLVM_INCLUDE_DOCS=0 -DLLVM_INCLUDE_TESTS=0 -DLLVM_TARGETS_TO_BUILD="ARM;X86;AArch64" -DCMAKE_INSTALL_PREFIX=install || exit /b 1 | ||
cmake --build . -j 10 --config Release --target install || exit /b 1 |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
ScriptPath="$(cd "$(dirname "$0")"; pwd -P)" | ||
|
||
# Clone the LLVM repo | ||
pushd "$1" || exit 1 | ||
if [ ! -d llvm ]; then | ||
git clone -b release_50 https://github.com/llvm-mirror/llvm.git || exit 1 | ||
fi | ||
|
||
# Clean the tree and apply the patch | ||
cd llvm && git restore . || exit 1 | ||
git apply "$ScriptPath/llvm.patch" || exit 1 | ||
|
||
# Add ObjWriter files | ||
rsync -av --delete "$ScriptPath/" tools/ObjWriter || exit 1 | ||
|
||
# Configure and build | ||
[ -d build ] || mkdir build | ||
cd build || exit 1 | ||
|
||
cmake ../ -DCMAKE_BUILD_TYPE=Release -DLLVM_OPTIMIZED_TABLEGEN=1 -DHAVE_POSIX_SPAWN=0 -DLLVM_ENABLE_PIC=1 -DLLVM_BUILD_TESTS=0 -DLLVM_ENABLE_DOXYGEN=0 -DLLVM_INCLUDE_DOCS=0 -DLLVM_INCLUDE_TESTS=0 -DLLVM_TARGETS_TO_BUILD="ARM;X86;AArch64" -DCMAKE_INSTALL_PREFIX=install || exit 1 | ||
cmake --build . -j 10 --config Release --target install || exit 1 |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project> | ||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> | ||
|
||
<PropertyGroup> | ||
<BuildScriptName Condition="'$(TargetOS)' == 'windows'">build.cmd</BuildScriptName> | ||
<BuildScriptName Condition="'$(TargetOS)' != 'windows'">build.sh</BuildScriptName> | ||
</PropertyGroup> | ||
|
||
<Target Name="Build"> | ||
<!-- Use IgnoreStandardErrorWarningFormat because Arcade sets WarnAsError and there are multiple warnings in the LLVM build --> | ||
<Exec Command="$(BuildScriptName) $(ArtifactsDir)" | ||
IgnoreStandardErrorWarningFormat="true" /> | ||
</Target> | ||
</Project> |