diff --git a/ChangeLog b/ChangeLog index a6788b35..888f359f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2013-11-29 Jay Berkenbilt + * Add /FS to msvc builds to allow parallel builds to work with + Visual C++ 2013. + * Add missing #include in some files that use std::min and std::max. diff --git a/configure.ac b/configure.ac index af54b6ce..683b239f 100644 --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,7 @@ if test "$BUILDRULES" = "msvc"; then dnl deprecated. Removing these warnings helps people who want to dnl write applications based on qpdf that can be Windows 8 dnl certified. - try_flags="/w14996" + try_flags="-w14996" else try_flags="-Wall" fi @@ -234,7 +234,23 @@ if test "$BUILDRULES" != "msvc"; then fi if test "$BUILDRULES" = "msvc"; then - try_flags="/WX" + try_flags=-FS + AC_MSG_CHECKING(for whether $CC supports $try_flags) + oCFLAGS=$CFLAGS + CFLAGS="$CFLAGS $try_flags" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int a = 1; int b = a; a = b;]])], + [qpdf_USE_FS=1],[qpdf_USE_FS=0]) + if test "$qpdf_USE_FS" = "1"; then + AC_MSG_RESULT(yes) + CXXFLAGS="$CXXFLAGS $try_flags" + else + AC_MSG_RESULT(no) + CFLAGS=$oCFLAGS + fi +fi + +if test "$BUILDRULES" = "msvc"; then + try_flags="-WX" else try_flags="-Werror" fi diff --git a/make/msvc.mk b/make/msvc.mk index 5e3bb570..bef53957 100644 --- a/make/msvc.mk +++ b/make/msvc.mk @@ -27,7 +27,7 @@ clean:: # 1 2 # Usage: $(call compile,src,includes) define compile - cl /nologo /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \ + cl /nologo /O2 /Zi /Gy /EHsc /MD /TP /GR $(CPPFLAGS) $(CXXFLAGS) \ $(foreach I,$(2),-I$(I)) \ /c $(1) /Fo$(call src_to_obj,$(1)) endef