Browse Source

Add LLVM commands to build.sh

pull/1529/head
josetr 5 years ago
parent
commit
9f4ea1f38c
  1. 10
      .github/workflows/llvm.yml
  2. 34
      build/build.sh
  3. 10
      docs/LLVM.md

10
.github/workflows/llvm.yml

@ -45,21 +45,17 @@ jobs: @@ -45,21 +45,17 @@ jobs:
shell: powershell
run: build/intrin.ps1
- name: Install dependencies
shell: bash
run: build/build.sh install_tools
- name: Clone LLVM
shell: bash
run: build/premake.sh --file=build/scripts/LLVM.lua clone_llvm
run: build/build.sh clone_llvm
- name: Build LLVM
shell: bash
run: build/premake.sh --file=build/scripts/LLVM.lua build_llvm --arch=$PLATFORM
run: build/build.sh build_llvm -platform $PLATFORM
- name: Package LLVM
shell: bash
run: build/premake.sh --file=build/scripts/LLVM.lua package_llvm --arch=$PLATFORM
run: build/build.sh package_llvm -platform $PLATFORM
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2

34
build/build.sh

@ -75,11 +75,6 @@ clean() @@ -75,11 +75,6 @@ clean()
rm -rf $slnpath
}
download_llvm()
{
$builddir/premake.sh --file=$builddir/scripts/LLVM.lua download_llvm --os=$os --arch=$platform --configuration=$configuration
}
download_premake()
{
premake_dir=$builddir/premake
@ -99,6 +94,26 @@ download_premake() @@ -99,6 +94,26 @@ download_premake()
fi
}
download_llvm()
{
$builddir/premake.sh --file=$builddir/llvm/LLVM.lua download_llvm --os=$os --arch=$platform --configuration=$configuration
}
clone_llvm()
{
$builddir/premake.sh --file=$builddir/llvm/LLVM.lua clone_llvm --os=$os --arch=$platform --configuration=$configuration
}
build_llvm()
{
$builddir/premake.sh --file=$builddir/llvm/LLVM.lua build_llvm --os=$os --arch=$platform --configuration=$configuration
}
package_llvm()
{
$builddir/premake.sh --file=$builddir/llvm/LLVM.lua package_llvm --os=$os --arch=$platform --configuration=$configuration
}
detect_os()
{
case "$(uname -s)" in
@ -181,6 +196,15 @@ case "$cmd" in @@ -181,6 +196,15 @@ case "$cmd" in
download_llvm)
download_llvm
;;
clone_llvm)
clone_llvm
;;
build_llvm)
build_llvm
;;
package_llvm)
package_llvm
;;
install_tools)
download_premake
;;

10
docs/LLVM.md

@ -21,14 +21,12 @@ Check the official download pages for each project for further instructions: @@ -21,14 +21,12 @@ Check the official download pages for each project for further instructions:
2. Navigate to the `<CppSharp>/build` directory
3. Clone, build and package LLVM with
```
$PREMAKE --file=scripts/LLVM.lua clone_llvm
$PREMAKE --file=scripts/LLVM.lua build_llvm
$PREMAKE --file=scripts/LLVM.lua package_llvm
./build.sh clone_llvm
./build.sh build_llvm
./build.sh package_llvm
```
`$PREMAKE` should be replaced with `premake5.exe`, `premake5-osx` or `premake5-linux` depending on environment.
You can specify an `--arch=x86` or `--arch=x64` flag to the invocations above to specify an explicit build architecture.
You can specify an `--platform=x86` or `--platform=x64` flag to the invocations above to specify an explicit build architecture.
If the `clone_llvm` step fails, you can try to manually clone LLVM and Clang as explained below.
You should still run clone_llvm to ensure that you are on the correct revision.

Loading…
Cancel
Save