Skip to content

Commit

Permalink
Windows and Darwin slang-llvm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Nov 20, 2023
1 parent 89f1e01 commit ff2a5fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/build-llvm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,43 @@ on:

jobs:
build:

runs-on: ubuntu-20.04
strategy:
matrix:
configuration: ['release']
platform: ['x64']
os: [ubuntu-20.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: install Ninja
run: sudo apt-get install -y ninja-build
- name: Set up system dependencies
shell: bash
run: |
case "${{matrix.os}}" in
ubuntu*) sudo apt-get install -y ninja-build;;
macos*) brew install ninja;;
windows*) choco install ninja;;
esac
# If we're on an old ubuntu, make sure that we set CC and CXX to GCC-10
[ "${{matrix-os}}" != "ubuntu-20.04" ] || printf "CC=gcc-10\nCXX=g++-10\n" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: '0'
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
- name: configure
shell: bash
run: |
mkdir -p build
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake -S . -B build \
-G "Ninja Multi-Config" \
-DSLANG_USE_BINARY_SLANG_LLVM=0 -DSLANG_USE_SYSTEM_LLVM=0 \
env:
CC: gcc-10
CXX: g++-10
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DSLANG_USE_BINARY_SLANG_LLVM=0 -DSLANG_USE_SYSTEM_LLVM=0
- name: build
shell: bash
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --build build -j $(nproc) --target slang-llvm --config Release
- uses: actions/upload-artifact@v3
with:
name: slang-llvm-${{matrix.configuration}}-${{matrix.platform}}
name: slang-llvm-${{matrix.os}}
path: |
build/Release/lib/libslang-llvm.so
build/Release/lib/libslang-llvm.dylib
build/Release/bin/slang-llvm.dll
9 changes: 3 additions & 6 deletions cmake/LLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ macro(find_llvm)
-G${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}
-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DCMAKE_INSTALL_PREFIX=${llvm_install_root}
Expand Down Expand Up @@ -73,14 +75,9 @@ macro(find_llvm)
WORKING_DIRECTORY ${llvm-project_SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
include(ProcessorCount)
ProcessorCount(nprocs)
if(nprocs EQUAL 0)
set(nprocs)
endif()
execute_process(
COMMAND
${CMAKE_COMMAND} --build ${llvm-project_BINARY_DIR} -j ${nprocs}
${CMAKE_COMMAND} --build ${llvm-project_BINARY_DIR} -j
--config=${llvm_config}
WORKING_DIRECTORY ${llvm-project_SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY
Expand Down

0 comments on commit ff2a5fe

Please sign in to comment.