fix: update build.zig
This commit is contained in:
parent
5044ec9c2f
commit
515d0965b0
1 changed files with 10 additions and 15 deletions
23
build.zig
23
build.zig
|
|
@ -45,6 +45,9 @@ pub fn build(b: *Build) !void {
|
||||||
"-Wno-suggest-override",
|
"-Wno-suggest-override",
|
||||||
"-Wno-unused-variable",
|
"-Wno-unused-variable",
|
||||||
"-fPIC",
|
"-fPIC",
|
||||||
|
"-static",
|
||||||
|
"-static-libgcc",
|
||||||
|
"-static-libstdc++"
|
||||||
};
|
};
|
||||||
|
|
||||||
try cppflags.appendSlice(base_flags);
|
try cppflags.appendSlice(base_flags);
|
||||||
|
|
@ -177,6 +180,8 @@ pub fn build(b: *Build) !void {
|
||||||
.target = target,
|
.target = target,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
glslang_exe.pie = true;
|
||||||
|
|
||||||
const install_glslang_step = b.step("glslang-standalone", "Build and install glslang.exe");
|
const install_glslang_step = b.step("glslang-standalone", "Build and install glslang.exe");
|
||||||
install_glslang_step.dependOn(&b.addInstallArtifact(glslang_exe, .{}).step);
|
install_glslang_step.dependOn(&b.addInstallArtifact(glslang_exe, .{}).step);
|
||||||
glslang_exe.addCSourceFiles(.{
|
glslang_exe.addCSourceFiles(.{
|
||||||
|
|
@ -189,12 +194,6 @@ pub fn build(b: *Build) !void {
|
||||||
b.installArtifact(glslang_exe);
|
b.installArtifact(glslang_exe);
|
||||||
glslang_exe.linkLibrary(glslang_lib);
|
glslang_exe.linkLibrary(glslang_lib);
|
||||||
|
|
||||||
if (target.result.os.tag == .windows) {
|
|
||||||
// windows must be built with LTO disabled due to:
|
|
||||||
// https://github.com/ziglang/zig/issues/15958
|
|
||||||
glslang_exe.want_lto = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enable_hlsl) {
|
if (enable_hlsl) {
|
||||||
glslang_exe.defineCMacro("ENABLE_HLSL", "1");
|
glslang_exe.defineCMacro("ENABLE_HLSL", "1");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -216,6 +215,8 @@ pub fn build(b: *Build) !void {
|
||||||
.target = target,
|
.target = target,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
spirv_remap.pie = true;
|
||||||
|
|
||||||
if (shared) {
|
if (shared) {
|
||||||
spirv_remap.defineCMacro("GLSLANG_IS_SHARED_LIBRARY", "");
|
spirv_remap.defineCMacro("GLSLANG_IS_SHARED_LIBRARY", "");
|
||||||
}
|
}
|
||||||
|
|
@ -231,10 +232,6 @@ pub fn build(b: *Build) !void {
|
||||||
|
|
||||||
b.installArtifact(spirv_remap);
|
b.installArtifact(spirv_remap);
|
||||||
spirv_remap.linkLibrary(glslang_lib);
|
spirv_remap.linkLibrary(glslang_lib);
|
||||||
|
|
||||||
if (target.result.os.tag == .windows) {
|
|
||||||
spirv_remap.want_lto = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -245,6 +242,8 @@ pub fn build(b: *Build) !void {
|
||||||
.target = target,
|
.target = target,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
min_test.pie = true;
|
||||||
|
|
||||||
if (shared) {
|
if (shared) {
|
||||||
min_test.defineCMacro("GLSLANG_IS_SHARED_LIBRARY", "");
|
min_test.defineCMacro("GLSLANG_IS_SHARED_LIBRARY", "");
|
||||||
}
|
}
|
||||||
|
|
@ -260,10 +259,6 @@ pub fn build(b: *Build) !void {
|
||||||
|
|
||||||
b.installArtifact(min_test);
|
b.installArtifact(min_test);
|
||||||
min_test.linkLibrary(glslang_lib);
|
min_test.linkLibrary(glslang_lib);
|
||||||
|
|
||||||
if (target.result.os.tag == .windows) {
|
|
||||||
min_test.want_lto = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue