aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-03-20 18:33:36 -0400
committerAndrew Kelley <andrew@ziglang.org>2020-03-20 18:33:36 -0400
commit3a2c4908891cdc9f64f0e94eb570ce084f8bc57c (patch)
tree406893c5de91823ce9da9191d5723e6a0df68e1c /lib/std
parent8429ddecf89bf0e78b2e0143e9a4a6e7ba88a0fb (diff)
downloadzig-3a2c4908891cdc9f64f0e94eb570ce084f8bc57c.tar.gz
zig-3a2c4908891cdc9f64f0e94eb570ce084f8bc57c.zip
"generate .h files" feature is no longer supported in stage1
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/build.zig18
-rw-r--r--lib/std/start.zig4
2 files changed, 12 insertions, 10 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig
index 09c77168d6..ac411d6cf6 100644
--- a/lib/std/build.zig
+++ b/lib/std/build.zig
@@ -1121,7 +1121,7 @@ pub const LibExeObjStep = struct {
emit_llvm_ir: bool = false,
emit_asm: bool = false,
emit_bin: bool = true,
- disable_gen_h: bool,
+ emit_h: bool = false,
bundle_compiler_rt: bool,
disable_stack_probing: bool,
disable_sanitize_c: bool,
@@ -1281,7 +1281,6 @@ pub const LibExeObjStep = struct {
.exec_cmd_args = null,
.name_prefix = "",
.filter = null,
- .disable_gen_h = false,
.bundle_compiler_rt = false,
.disable_stack_probing = false,
.disable_sanitize_c = false,
@@ -1600,8 +1599,9 @@ pub const LibExeObjStep = struct {
self.main_pkg_path = dir_path;
}
- pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void {
- self.disable_gen_h = value;
+ /// Deprecated; just set the field directly.
+ pub fn setDisableGenH(self: *LibExeObjStep, is_disabled: bool) void {
+ self.emit_h = !is_disabled;
}
pub fn setLibCFile(self: *LibExeObjStep, libc_file: ?[]const u8) void {
@@ -1632,7 +1632,7 @@ pub const LibExeObjStep = struct {
/// the make step, from a step that has declared a dependency on this one.
pub fn getOutputHPath(self: *LibExeObjStep) []const u8 {
assert(self.kind != Kind.Exe);
- assert(!self.disable_gen_h);
+ assert(self.emit_h);
return fs.path.join(
self.builder.allocator,
&[_][]const u8{ self.output_dir.?, self.out_h_filename },
@@ -1884,6 +1884,7 @@ pub const LibExeObjStep = struct {
if (self.emit_llvm_ir) try zig_args.append("-femit-llvm-ir");
if (self.emit_asm) try zig_args.append("-femit-asm");
if (!self.emit_bin) try zig_args.append("-fno-emit-bin");
+ if (self.emit_h) try zig_args.append("-femit-h");
if (self.strip) {
try zig_args.append("--strip");
@@ -1929,9 +1930,6 @@ pub const LibExeObjStep = struct {
if (self.is_dynamic) {
try zig_args.append("-dynamic");
}
- if (self.disable_gen_h) {
- try zig_args.append("--disable-gen-h");
- }
if (self.bundle_compiler_rt) {
try zig_args.append("--bundle-compiler-rt");
}
@@ -2069,7 +2067,7 @@ pub const LibExeObjStep = struct {
try zig_args.append("-isystem");
try zig_args.append(self.builder.pathFromRoot(include_path));
},
- .OtherStep => |other| if (!other.disable_gen_h) {
+ .OtherStep => |other| if (other.emit_h) {
const h_path = other.getOutputHPath();
try zig_args.append("-isystem");
try zig_args.append(fs.path.dirname(h_path).?);
@@ -2209,7 +2207,7 @@ const InstallArtifactStep = struct {
break :blk InstallDir.Lib;
}
} else null,
- .h_dir = if (artifact.kind == .Lib and !artifact.disable_gen_h) .Header else null,
+ .h_dir = if (artifact.kind == .Lib and artifact.emit_h) .Header else null,
};
self.step.dependOn(&artifact.step);
artifact.install_step = self;
diff --git a/lib/std/start.zig b/lib/std/start.zig
index 857af03b56..1a4997edbd 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -41,6 +41,10 @@ fn _DllMainCRTStartup(
fdwReason: std.os.windows.DWORD,
lpReserved: std.os.windows.LPVOID,
) callconv(.Stdcall) std.os.windows.BOOL {
+ if (!builtin.single_threaded) {
+ _ = @import("start_windows_tls.zig");
+ }
+
if (@hasDecl(root, "DllMain")) {
return root.DllMain(hinstDLL, fdwReason, lpReserved);
}