Commit 88c29873e56e69c83aa0d0798188cd792368059b
1 parent
b75b1958
Add /FS flag (msvc) for parallel builds
Showing
3 changed files
with
22 additions
and
3 deletions
ChangeLog
| 1 | 2013-11-29 Jay Berkenbilt <ejb@ql.org> | 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 | * Add missing #include <algorithm> in some files that use std::min | 6 | * Add missing #include <algorithm> in some files that use std::min |
| 4 | and std::max. | 7 | and std::max. |
| 5 | 8 |
configure.ac
| @@ -200,7 +200,7 @@ if test "$BUILDRULES" = "msvc"; then | @@ -200,7 +200,7 @@ if test "$BUILDRULES" = "msvc"; then | ||
| 200 | dnl deprecated. Removing these warnings helps people who want to | 200 | dnl deprecated. Removing these warnings helps people who want to |
| 201 | dnl write applications based on qpdf that can be Windows 8 | 201 | dnl write applications based on qpdf that can be Windows 8 |
| 202 | dnl certified. | 202 | dnl certified. |
| 203 | - try_flags="/w14996" | 203 | + try_flags="-w14996" |
| 204 | else | 204 | else |
| 205 | try_flags="-Wall" | 205 | try_flags="-Wall" |
| 206 | fi | 206 | fi |
| @@ -234,7 +234,23 @@ if test "$BUILDRULES" != "msvc"; then | @@ -234,7 +234,23 @@ if test "$BUILDRULES" != "msvc"; then | ||
| 234 | fi | 234 | fi |
| 235 | 235 | ||
| 236 | if test "$BUILDRULES" = "msvc"; then | 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 | else | 254 | else |
| 239 | try_flags="-Werror" | 255 | try_flags="-Werror" |
| 240 | fi | 256 | fi |
make/msvc.mk
| @@ -27,7 +27,7 @@ clean:: | @@ -27,7 +27,7 @@ clean:: | ||
| 27 | # 1 2 | 27 | # 1 2 |
| 28 | # Usage: $(call compile,src,includes) | 28 | # Usage: $(call compile,src,includes) |
| 29 | define compile | 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 | $(foreach I,$(2),-I$(I)) \ | 31 | $(foreach I,$(2),-I$(I)) \ |
| 32 | /c $(1) /Fo$(call src_to_obj,$(1)) | 32 | /c $(1) /Fo$(call src_to_obj,$(1)) |
| 33 | endef | 33 | endef |