Skip to content

Commit

Permalink
misc: Add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwinci committed Oct 16, 2024
1 parent d8d4c07 commit be8deb9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/it-compiles-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: It Compiles!
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install llvm
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19
sudo rm -f $(which clang) $(which clang++)
sudo rm -f /usr/bin/clang /usr/bin/clang++
sudo ln -s $(which clang-19) /usr/bin/clang
sudo ln -s $(which clang++-19) /usr/bin/clang++
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install binutils gcc g++ cmake ninja-build xorriso acpica-tools git -y
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

- name: Build (x86_64 Clang)
run: |
cmake -B build_x86_64_clang -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
ninja -C build_x86_64_clang
- name: Build (x86_64 Gcc)
run: |
cmake -B build_x86_64_gcc -G Ninja
ninja -C build_x86_64_gcc
- name: Build (Aarch64 Clang)
run: |
cmake -B build_aarch64_clang -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_clang_aarch64.cmake
ninja -C build_aarch64_clang
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ endif()

add_subdirectory(src)

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(crescent PRIVATE -Wno-unused-command-line-argument)
endif()

if(ARCH STREQUAL "x86_64")
target_compile_options(crescent PRIVATE -fPIE)
target_compile_definitions(crescent PRIVATE ARCH_X86_64)
Expand Down

0 comments on commit be8deb9

Please sign in to comment.