diff --git a/.github/workflows/llvm.yml b/.github/workflows/llvm.yml index 1a4c7c97..51386cdd 100644 --- a/.github/workflows/llvm.yml +++ b/.github/workflows/llvm.yml @@ -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 diff --git a/build/build.sh b/build/build.sh index 9e340583..28b6080d 100755 --- a/build/build.sh +++ b/build/build.sh @@ -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() 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 download_llvm) download_llvm ;; + clone_llvm) + clone_llvm + ;; + build_llvm) + build_llvm + ;; + package_llvm) + package_llvm + ;; install_tools) download_premake ;; diff --git a/docs/LLVM.md b/docs/LLVM.md index cfeebd18..55f039be 100644 --- a/docs/LLVM.md +++ b/docs/LLVM.md @@ -21,14 +21,12 @@ Check the official download pages for each project for further instructions: 2. Navigate to the `/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.