aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-02-25 13:34:25 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-02-25 13:34:25 -0500
commit525c2eaf5d49f537d4ccd48ab0c5bc1f52cc3204 (patch)
treecf66d3fd2b48f894048dbdfae93e8f5ad1e6e22a /src/main.cpp
parente76ce2c1d0d3988359267fd3030a81a52ec99f3f (diff)
downloadzig-525c2eaf5d49f537d4ccd48ab0c5bc1f52cc3204.tar.gz
zig-525c2eaf5d49f537d4ccd48ab0c5bc1f52cc3204.zip
building DLLs on Windows works better
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a7f6e0b95d..1c154250ff 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -60,6 +60,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
" --name [name] override output name\n"
" --output [file] override destination path\n"
" --output-h [file] generate header file\n"
+ " --output-lib [file] override import library path\n"
" --pkg-begin [name] [path] make pkg available to import and push current pkg\n"
" --pkg-end pop current pkg\n"
" --release-fast build with optimizations on and safety off\n"
@@ -375,6 +376,7 @@ int main(int argc, char **argv) {
const char *in_file = nullptr;
const char *out_file = nullptr;
const char *out_file_h = nullptr;
+ const char *out_file_lib = nullptr;
bool strip = false;
bool is_static = false;
OutType out_type = OutTypeUnknown;
@@ -661,6 +663,8 @@ int main(int argc, char **argv) {
out_file = argv[i];
} else if (strcmp(arg, "--output-h") == 0) {
out_file_h = argv[i];
+ } else if (strcmp(arg, "--output-lib") == 0) {
+ out_file_lib = argv[i];
} else if (strcmp(arg, "--color") == 0) {
if (strcmp(argv[i], "auto") == 0) {
color = ErrColorAuto;
@@ -1094,6 +1098,8 @@ int main(int argc, char **argv) {
codegen_set_output_path(g, buf_create_from_str(out_file));
if (out_file_h != nullptr && (out_type == OutTypeObj || out_type == OutTypeLib))
codegen_set_output_h_path(g, buf_create_from_str(out_file_h));
+ if (out_file_lib != nullptr && out_type == OutTypeLib && !is_static)
+ codegen_set_output_lib_path(g, buf_create_from_str(out_file_lib));
add_package(g, cur_pkg, g->root_package);