As per Microsoft dev blog here -
VC compiler reports wrong value for macro __cplusplus and need a "special"
compiler flag to fix it. Updating make file accordingly.
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -81,11 +81,15 @@ set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${TCMALLOC_COMPILE_OPTIONS} ${MY_CXX_WARNING_FLAGS}")
if(MSVC)
+ add_compile_definitions(PLI_DLLISPEC=)
+ add_compile_definitions(ANTLR4CPP_STATIC)
+ add_compile_definitions(_CRT_NONSTDC_NO_WARNINGS)
+
set(CMAKE_CXX_FLAGS_DEBUG
- "${CMAKE_CXX_FLAGS_DEBUG} ${TCMALLOC_COMPILE_OPTIONS} /W0 /bigobj /DPLI_DLLISPEC= /DANTLR4CPP_STATIC /D_CRT_NONSTDC_NO_WARNINGS ${MY_CXX_WARNING_FLAGS}"
+ "${CMAKE_CXX_FLAGS_DEBUG} ${TCMALLOC_COMPILE_OPTIONS} /Zc:__cplusplus /W0 /bigobj ${MY_CXX_WARNING_FLAGS}"
)
set(CMAKE_CXX_FLAGS_RELEASE
- "${CMAKE_CXX_FLAGS_RELEASE} ${TCMALLOC_COMPILE_OPTIONS}/W0 /bigobj /DPLI_DLLISPEC= /DANTLR4CPP_STATIC /D_CRT_NONSTDC_NO_WARNINGS ${MY_CXX_WARNING_FLAGS}"
+ "${CMAKE_CXX_FLAGS_RELEASE} ${TCMALLOC_COMPILE_OPTIONS} /Zc:__cplusplus /W0 /bigobj ${MY_CXX_WARNING_FLAGS}"
)
set(CMAKE_EXE_LINKER_FLAGS /STACK:8388608) # 8MB stack size
else()

As per Microsoft dev blog here -
https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
VC compiler reports wrong value for macro __cplusplus and need a "special"
compiler flag to fix it. Updating make file accordingly.