Commit 88c29873e56e69c83aa0d0798188cd792368059b

Authored by Jay Berkenbilt
1 parent b75b1958

Add /FS flag (msvc) for parallel builds

ChangeLog
1 1 2013-11-29 Jay Berkenbilt <ejb@ql.org>
2 2  
  3 + * Add /FS to msvc builds to allow parallel builds to work with
  4 + Visual C++ 2013.
  5 +
3 6 * Add missing #include <algorithm> in some files that use std::min
4 7 and std::max.
5 8  
... ...
configure.ac
... ... @@ -200,7 +200,7 @@ if test &quot;$BUILDRULES&quot; = &quot;msvc&quot;; then
200 200 dnl deprecated. Removing these warnings helps people who want to
201 201 dnl write applications based on qpdf that can be Windows 8
202 202 dnl certified.
203   - try_flags="/w14996"
  203 + try_flags="-w14996"
204 204 else
205 205 try_flags="-Wall"
206 206 fi
... ... @@ -234,7 +234,23 @@ if test &quot;$BUILDRULES&quot; != &quot;msvc&quot;; then
234 234 fi
235 235  
236 236 if test "$BUILDRULES" = "msvc"; then
237   - try_flags="/WX"
  237 + try_flags=-FS
  238 + AC_MSG_CHECKING(for whether $CC supports $try_flags)
  239 + oCFLAGS=$CFLAGS
  240 + CFLAGS="$CFLAGS $try_flags"
  241 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = 1; int b = a; a = b;]])],
  242 + [qpdf_USE_FS=1],[qpdf_USE_FS=0])
  243 + if test "$qpdf_USE_FS" = "1"; then
  244 + AC_MSG_RESULT(yes)
  245 + CXXFLAGS="$CXXFLAGS $try_flags"
  246 + else
  247 + AC_MSG_RESULT(no)
  248 + CFLAGS=$oCFLAGS
  249 + fi
  250 +fi
  251 +
  252 +if test "$BUILDRULES" = "msvc"; then
  253 + try_flags="-WX"
238 254 else
239 255 try_flags="-Werror"
240 256 fi
... ...
make/msvc.mk
... ... @@ -27,7 +27,7 @@ clean::
27 27 # 1 2
28 28 # Usage: $(call compile,src,includes)
29 29 define compile
30   - cl /nologo /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \
  30 + cl /nologo /O2 /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \
31 31 $(foreach I,$(2),-I$(I)) \
32 32 /c $(1) /Fo$(call src_to_obj,$(1))
33 33 endef
... ...