Fix a couple of issues with the CMake script
[folly.git] / CMake / FollyCompiler.cmake
index e01f6569bf260c834d21b4f5f55f4829c1ad2fa5..29d2ca2e5ad951e6ac4ed688f50f08e4841d127b 100755 (executable)
@@ -54,7 +54,9 @@ function(apply_folly_compile_options_to_target THETARGET)
       /Zc:strictStrings # Don't allow conversion from a string literal to mutable characters.\r
       /Zc:threadSafeInit # Enable thread-safe function-local statics initialization.\r
       /Zc:throwingNew # Assume operator new throws on failure.\r
-      /permissive- # Be mean, don't allow bad non-standard stuff (C++/CLI, __declspec, etc. are all left intact).\r
+\r
+      # This is only supported by MSVC 2017\r
+      $<$<BOOL:${MSVC_IS_2017}>:/permissive-> # Be mean, don't allow bad non-standard stuff (C++/CLI, __declspec, etc. are all left intact).\r
     PRIVATE\r
       /bigobj # Support objects with > 65k sections. Needed due to templates.\r
       /favor:${MSVC_FAVORED_ARCHITECTURE} # Architecture to prefer when generating code.\r