cmake: support using a separate build directory
[folly.git] / CMake / FollyCompiler.cmake
index 5b0058a7fc6f774c524558ce5f21aa4d88dd6573..3c8093755c75c18bdcb3d2d301f777b4420eef40 100755 (executable)
@@ -72,6 +72,7 @@ function(apply_folly_compile_options_to_target THETARGET)
   target_compile_options(${THETARGET}\r
     PUBLIC\r
       /EHa # Enable both SEH and C++ Exceptions.\r
+      /GF # There are bugs with constexpr StringPiece when string pooling is disabled.\r
       /Zc:referenceBinding # Disallow temporaries from binding to non-const lvalue references.\r
       /Zc:rvalueCast # Enforce the standard rules for explicit type conversion.\r
       /Zc:implicitNoexcept # Enable implicit noexcept specifications where required, such as destructors.\r
@@ -95,14 +96,12 @@ function(apply_folly_compile_options_to_target THETARGET)
       # Debug builds\r
       $<$<CONFIG:DEBUG>:\r
         /Gy- # Disable function level linking.\r
-        /GF- # Disable string pooling.\r
 \r
         $<$<BOOL:${MSVC_ENABLE_DEBUG_INLINING}>:/Ob2> # Add /Ob2 if allowing inlining in debug mode.\r
       >\r
 \r
       # Non-debug builds\r
       $<$<NOT:$<CONFIG:DEBUG>>:\r
-        /GF # Enable string pooling. (this is enabled by default by the optimization level, but we enable it here for clarity)\r
         /Gw # Optimize global data. (-fdata-sections)\r
         /Gy # Enable function level linking. (-ffunction-sections)\r
         /Qpar # Enable parallel code generation.\r
@@ -122,6 +121,7 @@ function(apply_folly_compile_options_to_target THETARGET)
       /wd4366 # result of unary '&' operator may be unaligned\r
       /wd4587 # behavior change; constructor no longer implicitly called\r
       /wd4592 # symbol will be dynamically initialized (implementation limitation)\r
+      /wd4628 # digraphs not supported with -Ze\r
       /wd4723 # potential divide by 0\r
       /wd4724 # potential mod by 0\r
       /wd4868 # compiler may not enforce left-to-right evaluation order\r