From 2c73e49dac07503fddb281c1d3cef8a2c5169b55 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Wed, 1 Apr 2015 13:52:07 +0300 Subject: [PATCH] Not block PDB file in multithreaded build on Windows. If used cl compiler, but generator is not Visual Studio e.g. Ninja, enable FS option to prevent blocking PDB file in multithreaded build. --- cmake/OpenCVCompilerOptions.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index 13559b5c8..9535f743a 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -265,6 +265,11 @@ if(MSVC) endif() endif() +if(MSVC12 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /FS") + set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /FS") +endif() + # Extra link libs if the user selects building static libs: if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID) # Android does not need these settings because they are already set by toolchain file