Compare commits

...

3 commits

Author SHA1 Message Date
e02fb699fc
move away from deprecated API
Some checks failed
aws-zig mach nominated build / build-zig-nominated-mach-latest (push) Successful in 39s
aws-zig nightly build / build-zig-nightly (push) Failing after 1m21s
2024-12-19 08:54:30 -08:00
35fad85c13
add .envrc 2024-12-19 08:48:37 -08:00
88d7e99d6b
add a build option to disable LLVM 2024-12-19 08:43:25 -08:00
2 changed files with 19 additions and 1 deletions

8
.envrc Normal file
View file

@ -0,0 +1,8 @@
# vi: ft=sh
# shellcheck shell=bash
if ! has zvm_direnv_version || ! zvm_direnv_version 1.0.0; then
source_url "https://git.lerch.org/lobo/zvm-direnv/raw/tag/1.0.0/direnvrc" "sha256-Gtddvcr6aJsrjKd53uChxA1reQmJgEBpmPUWmMdtDIQ="
fi
use zig mach-latest

View file

@ -29,6 +29,12 @@ pub fn build(b: *Builder) !void {
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const optimize = b.standardOptimizeOption(.{});
const no_llvm = b.option(
bool,
"no-llvm",
"Disable LLVM",
) orelse false;
const broken_windows = b.option(
bool,
"broken-windows",
@ -52,6 +58,7 @@ pub fn build(b: *Builder) !void {
.target = target,
.optimize = optimize,
});
exe.use_llvm = !no_llvm;
const smithy_dep = b.dependency("smithy", .{
// These are the arguments to the dependency. It expects a target and optimization level.
.target = target,
@ -100,9 +107,10 @@ pub fn build(b: *Builder) !void {
.name = "codegen",
.root_source_file = b.path("codegen/src/main.zig"),
// We need this generated for the host, not the real target
.target = b.host,
.target = b.graph.host,
.optimize = if (b.verbose) .Debug else .ReleaseSafe,
});
cg_exe.use_llvm = !no_llvm;
cg_exe.root_module.addImport("smithy", smithy_dep.module("smithy"));
var cg_cmd = b.addRunArtifact(cg_exe);
cg_cmd.addArg("--models");
@ -179,6 +187,7 @@ pub fn build(b: *Builder) !void {
});
unit_tests.root_module.addImport("smithy", smithy_dep.module("smithy"));
unit_tests.step.dependOn(gen_step);
unit_tests.use_llvm = !no_llvm;
const run_unit_tests = b.addRunArtifact(unit_tests);
run_unit_tests.skip_foreign_checks = true;
@ -200,6 +209,7 @@ pub fn build(b: *Builder) !void {
.target = target,
.optimize = optimize,
});
smoke_test.use_llvm = !no_llvm;
smoke_test.root_module.addImport("smithy", smithy_dep.module("smithy"));
smoke_test.step.dependOn(gen_step);