Compare commits
3 commits
debb4dab60
...
e02fb699fc
Author | SHA1 | Date | |
---|---|---|---|
e02fb699fc | |||
35fad85c13 | |||
88d7e99d6b |
2 changed files with 19 additions and 1 deletions
8
.envrc
Normal file
8
.envrc
Normal 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
|
12
build.zig
12
build.zig
|
@ -29,6 +29,12 @@ pub fn build(b: *Builder) !void {
|
||||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
|
const no_llvm = b.option(
|
||||||
|
bool,
|
||||||
|
"no-llvm",
|
||||||
|
"Disable LLVM",
|
||||||
|
) orelse false;
|
||||||
|
|
||||||
const broken_windows = b.option(
|
const broken_windows = b.option(
|
||||||
bool,
|
bool,
|
||||||
"broken-windows",
|
"broken-windows",
|
||||||
|
@ -52,6 +58,7 @@ pub fn build(b: *Builder) !void {
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
exe.use_llvm = !no_llvm;
|
||||||
const smithy_dep = b.dependency("smithy", .{
|
const smithy_dep = b.dependency("smithy", .{
|
||||||
// These are the arguments to the dependency. It expects a target and optimization level.
|
// These are the arguments to the dependency. It expects a target and optimization level.
|
||||||
.target = target,
|
.target = target,
|
||||||
|
@ -100,9 +107,10 @@ pub fn build(b: *Builder) !void {
|
||||||
.name = "codegen",
|
.name = "codegen",
|
||||||
.root_source_file = b.path("codegen/src/main.zig"),
|
.root_source_file = b.path("codegen/src/main.zig"),
|
||||||
// We need this generated for the host, not the real target
|
// 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,
|
.optimize = if (b.verbose) .Debug else .ReleaseSafe,
|
||||||
});
|
});
|
||||||
|
cg_exe.use_llvm = !no_llvm;
|
||||||
cg_exe.root_module.addImport("smithy", smithy_dep.module("smithy"));
|
cg_exe.root_module.addImport("smithy", smithy_dep.module("smithy"));
|
||||||
var cg_cmd = b.addRunArtifact(cg_exe);
|
var cg_cmd = b.addRunArtifact(cg_exe);
|
||||||
cg_cmd.addArg("--models");
|
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.root_module.addImport("smithy", smithy_dep.module("smithy"));
|
||||||
unit_tests.step.dependOn(gen_step);
|
unit_tests.step.dependOn(gen_step);
|
||||||
|
unit_tests.use_llvm = !no_llvm;
|
||||||
|
|
||||||
const run_unit_tests = b.addRunArtifact(unit_tests);
|
const run_unit_tests = b.addRunArtifact(unit_tests);
|
||||||
run_unit_tests.skip_foreign_checks = true;
|
run_unit_tests.skip_foreign_checks = true;
|
||||||
|
@ -200,6 +209,7 @@ pub fn build(b: *Builder) !void {
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
smoke_test.use_llvm = !no_llvm;
|
||||||
smoke_test.root_module.addImport("smithy", smithy_dep.module("smithy"));
|
smoke_test.root_module.addImport("smithy", smithy_dep.module("smithy"));
|
||||||
smoke_test.step.dependOn(gen_step);
|
smoke_test.step.dependOn(gen_step);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue