diff --git a/.github/workflows/zigbuild.yml b/.github/workflows/zigbuild.yml index 3ba94da..f9be62a 100644 --- a/.github/workflows/zigbuild.yml +++ b/.github/workflows/zigbuild.yml @@ -10,23 +10,21 @@ jobs: runs-on: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - uses: goto-bus-stop/setup-zig@v2 - with: - version: master - name: Install LLVM (Linux) if: startsWith(matrix.runs-on, 'ubuntu') run: | sudo apt update sudo apt install -y wget - sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" + sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc sudo apt update - sudo apt install -y llvm-16 + sudo apt install -y llvm-17 - name: Install LLVM (MacOS) if: startsWith(matrix.runs-on, 'macos') diff --git a/build.zig b/build.zig index 4d77e19..cce30b8 100644 --- a/build.zig +++ b/build.zig @@ -45,7 +45,7 @@ fn buildExample(b: *std.Build, i: BuildInfo) void { exe.addModule("llvm", b.modules.get("llvm").?); exe.linkSystemLibrary("z"); switch (i.target.getOsTag()) { - .linux => exe.linkSystemLibrary("LLVM-16"), // Ubuntu + .linux => exe.linkSystemLibrary("LLVM-17"), // Ubuntu .macos => { exe.addLibraryPath(.{ .path = "/usr/local/opt/llvm/lib" }); exe.linkSystemLibrary("LLVM"); diff --git a/examples/fatorial_module.zig b/examples/fatorial_module.zig index 3cc98dd..148ea84 100644 --- a/examples/fatorial_module.zig +++ b/examples/fatorial_module.zig @@ -15,8 +15,8 @@ pub fn main() void { defer core.LLVMShutdown(); // Create a new LLVM module - var module: types.LLVMModuleRef = core.LLVMModuleCreateWithName("factorial_module"); - var builder: types.LLVMBuilderRef = core.LLVMCreateBuilder(); + const module: types.LLVMModuleRef = core.LLVMModuleCreateWithName("factorial_module"); + const builder: types.LLVMBuilderRef = core.LLVMCreateBuilder(); // Create the factorial function const returnType: types.LLVMTypeRef = core.LLVMInt32Type(); diff --git a/examples/sum_module.zig b/examples/sum_module.zig index 840a37e..8d981cf 100644 --- a/examples/sum_module.zig +++ b/examples/sum_module.zig @@ -11,7 +11,7 @@ pub fn main() void { _ = target.LLVMInitializeNativeAsmParser(); // Create a new LLVM module - var module: types.LLVMModuleRef = core.LLVMModuleCreateWithName("sum_module"); + const module: types.LLVMModuleRef = core.LLVMModuleCreateWithName("sum_module"); var params: [2]types.LLVMTypeRef = [_]types.LLVMTypeRef{ core.LLVMInt32Type(), core.LLVMInt32Type(),