diff -ruN src\CMakeLists.txt src.new\CMakeLists.txt --- src\CMakeLists.txt Mon Mar 05 18:11:11 2018 +++ src.new\CMakeLists.txt Mon Mar 05 18:11:32 2018 @@ -60,17 +60,8 @@ caffe_option(COPY_PREREQUISITES "Copy the prerequisites next to each executable or shared library directory" ON IF MSVC) caffe_option(INSTALL_PREREQUISITES "Install the prerequisites next to each executable or shared library directory" ON IF MSVC) -if(MSVC AND BUILD_SHARED_LIBS) - if(CMAKE_GENERATOR MATCHES "Visual Studio") - # see issue https://gitlab.kitware.com/cmake/cmake/issues/16552#note_215236 - message(FATAL_ERROR "The Visual Studio generator cannot build a shared library. Use the Ninja generator instead.") - endif() - # Some tests (solver tests) fail when caffe is built as a shared library. The problem comes - # from protobuf that has a global static empty_string_ variable. Since caffe and test.testbin - # link to a static protobuf library both end up with their own instance of the empty_string_ - # variable. This causes some SEH exception to occur. In practice if the caffe executable does not link - # to protobuf this problem should not happen. Use at your own risk. - message(WARNING "Some tests (solvers) will fail when building as a shared library with MSVC") +if(MSVC) + add_compile_options("-DNO_STRICT") endif() # ---[ Prebuild dependencies on windows