aboutsummaryrefslogtreecommitdiffstats
path: root/make/msvc.mk
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-11-09 21:01:15 +0100
committerJay Berkenbilt <ejb@ql.org>2019-11-10 00:50:42 +0100
commit07da0039d3f496871d746305fbbf76ee9bde9862 (patch)
tree2bd79ba09951f77ba2d2866c339b2f73313a25c2 /make/msvc.mk
parenta58918bb8756c7c8efb12a6a283cc7f879565141 (diff)
downloadqpdf-07da0039d3f496871d746305fbbf76ee9bde9862.tar.zst
Link with setargv or wsetargv with MSVC (fixes #224)
For wildcard expansion to work properly with the msvc binary, it is necessary to link with setargv.obj or wsetargv.obj, depending on whether wmain is in use.
Diffstat (limited to 'make/msvc.mk')
-rw-r--r--make/msvc.mk5
1 files changed, 3 insertions, 2 deletions
diff --git a/make/msvc.mk b/make/msvc.mk
index 1dafbcf0..108ce3b6 100644
--- a/make/msvc.mk
+++ b/make/msvc.mk
@@ -76,10 +76,11 @@ define makelib
mv $(basename $(2))$(shell expr $(5) - $(7)).lib $(2)
endef
-# 1 2 3 4
-# Usage: $(call makebin,objs,binary,ldflags,libs)
+# 1 2 3 4 5
+# Usage: $(call makebin,objs,binary,ldflags,libs,xlinkflags)
define makebin
cl -nologo -O2 -Zi -Gy -EHsc -MD $(1) \
+ $(if $(5),$(5),$(WINDOWS_MAIN_XLINK_FLAGS)) \
-link -SUBSYSTEM:CONSOLE,5.01 -incremental:no -OUT:$(2) \
$(foreach L,$(subst -L,,$(3)),-LIBPATH:$(L)) \
$(foreach L,$(subst -l,,$(4)),$(L).lib)