| 1 |
# ===--- |
| 2 |
# Main opencl-clang building script |
| 3 |
# ===--- |
| 4 |
|
| 5 |
name: Build opencl-clang |
| 6 |
inputs: |
| 7 |
ref_llvm: |
| 8 |
description: 'LLVM ref to build with' |
| 9 |
required: true |
| 10 |
ref_translator: |
| 11 |
description: 'SPIRV-LLVM-Translator ref to build with' |
| 12 |
required: true |
| 13 |
ref_opencl-clang: |
| 14 |
description: 'opencl-clang ref to build with' |
| 15 |
required: true |
| 16 |
build_type: |
| 17 |
description: 'Build type to pass to CMake' |
| 18 |
required: false |
| 19 |
default: Release |
| 20 |
|
| 21 |
runs: |
| 22 |
using: 'composite' |
| 23 |
steps: |
| 24 |
|
| 25 |
# Setup git credentials to make applying patches possible |
| 26 |
- run: | |
| 27 |
git config --global user.email "[email protected]" |
| 28 |
git config --global user.name "Action Bot" |
| 29 |
shell: bash |
| 30 |
|
| 31 |
- name: Checkout LLVM |
| 32 |
uses: actions/checkout@v3 |
| 33 |
with: |
| 34 |
repository: llvm/llvm-project |
| 35 |
path: llvm-project |
| 36 |
ref: ${{ inputs.ref_llvm }} |
| 37 |
|
| 38 |
- name: Checkout SPIRV-LLVM-Translator |
| 39 |
uses: actions/checkout@v3 |
| 40 |
with: |
| 41 |
repository: KhronosGroup/SPIRV-LLVM-Translator |
| 42 |
path: llvm-project/SPIRV-LLVM-Translator |
| 43 |
ref: ${{ inputs.ref_translator }} |
| 44 |
|
| 45 |
- name: Checkout opencl-clang |
| 46 |
uses: actions/checkout@v3 |
| 47 |
with: |
| 48 |
path: llvm-project/opencl-clang |
| 49 |
ref: ${{ inputs.ref_opencl-clang }} |
| 50 |
|
| 51 |
- name: Configure |
| 52 |
shell: bash |
| 53 |
run: | |
| 54 |
mkdir build && cd build |
| 55 |
cmake ${{ github.workspace }}/llvm-project/llvm \ |
| 56 |
-DLLVM_ENABLE_PROJECTS="clang" \ |
| 57 |
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;opencl-clang" \ |
| 58 |
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${{ github.workspace }}/llvm-project/SPIRV-LLVM-Translator \ |
| 59 |
-DLLVM_EXTERNAL_OPENCL_CLANG_SOURCE_DIR=${{ github.workspace }}/llvm-project/opencl-clang \ |
| 60 |
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \ |
| 61 |
-DLLVM_TARGETS_TO_BUILD="X86" \ |
| 62 |
-G "Unix Makefiles" |
| 63 |
|
| 64 |
- name: Build |
| 65 |
shell: bash |
| 66 |
run: | |
| 67 |
cd build |
| 68 |
make opencl-clang -j8 |