aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-10-15 19:47:27 -0700
committerGitHub <noreply@github.com>2023-10-15 19:47:27 -0700
commitca690ffa22ab4463e53b547d109a2b2081771e05 (patch)
tree3557c38c0f5b1c792a97fc6a1838bd9952b97c0e /lib/std/Build.zig
parentebde525ccee41a8eefbb868cf4df756f1a937dd2 (diff)
parentb51147889f1c44d380818977a4dbefebffb8d91f (diff)
downloadzig-ca690ffa22ab4463e53b547d109a2b2081771e05.tar.gz
zig-ca690ffa22ab4463e53b547d109a2b2081771e05.zip
Merge pull request #17448 from squeek502/win32-manifest
Add preliminary support for Windows `.manifest` files
Diffstat (limited to 'lib/std/Build.zig')
-rw-r--r--lib/std/Build.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/std/Build.zig b/lib/std/Build.zig
index 5c80f4972c..f1c6761303 100644
--- a/lib/std/Build.zig
+++ b/lib/std/Build.zig
@@ -635,6 +635,12 @@ pub const ExecutableOptions = struct {
use_lld: ?bool = null,
zig_lib_dir: ?LazyPath = null,
main_mod_path: ?LazyPath = null,
+ /// Embed a `.manifest` file in the compilation if the object format supports it.
+ /// https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-files-reference
+ /// Manifest files must have the extension `.manifest`.
+ /// Can be set regardless of target. The `.manifest` file will be ignored
+ /// if the target object format does not support embedded manifests.
+ win32_manifest: ?LazyPath = null,
/// Deprecated; use `main_mod_path`.
main_pkg_path: ?LazyPath = null,
@@ -656,6 +662,7 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {
.use_lld = options.use_lld,
.zig_lib_dir = options.zig_lib_dir orelse b.zig_lib_dir,
.main_mod_path = options.main_mod_path orelse options.main_pkg_path,
+ .win32_manifest = options.win32_manifest,
});
}
@@ -706,6 +713,12 @@ pub const SharedLibraryOptions = struct {
use_lld: ?bool = null,
zig_lib_dir: ?LazyPath = null,
main_mod_path: ?LazyPath = null,
+ /// Embed a `.manifest` file in the compilation if the object format supports it.
+ /// https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-files-reference
+ /// Manifest files must have the extension `.manifest`.
+ /// Can be set regardless of target. The `.manifest` file will be ignored
+ /// if the target object format does not support embedded manifests.
+ win32_manifest: ?LazyPath = null,
/// Deprecated; use `main_mod_path`.
main_pkg_path: ?LazyPath = null,
@@ -727,6 +740,7 @@ pub fn addSharedLibrary(b: *Build, options: SharedLibraryOptions) *Step.Compile
.use_lld = options.use_lld,
.zig_lib_dir = options.zig_lib_dir orelse b.zig_lib_dir,
.main_mod_path = options.main_mod_path orelse options.main_pkg_path,
+ .win32_manifest = options.win32_manifest,
});
}