ColinLeeo commented on code in PR #817:
URL: https://github.com/apache/tsfile/pull/817#discussion_r3278359945


##########
cpp/CMakeLists.txt:
##########
@@ -178,7 +231,15 @@ set(LIBRARY_INCLUDE_DIR ${PROJECT_BINARY_DIR}/include 
CACHE STRING "TsFile inclu
 set(THIRD_PARTY_INCLUDE ${PROJECT_BINARY_DIR}/third_party)
 
 set(SAVED_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -Wall -std=c++11")
+if (MSVC)
+    # MSVC does not provide a /std:c++11 flag; C++11 is its implicit baseline.
+    # The lowest explicitly settable standard is /std:c++14. Without this flag,
+    # the default varies by VS version (VS2017+ defaults to C++14 mode with 
some
+    # C++17 extensions), so we pin it explicitly for reproducibility.
+    set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} /W3 /utf-8 /EHsc /bigobj 
/Zc:__cplusplus /std:c++14")

Review Comment:
   Our code targets C++11; /std:c++14 is used on MSVC 2017 only because MSVC 
2017 has no /std:c++11 option (C++14 is its minimum). For older MSVC 
(2013/2015), the flag should just be omitted via if(MSVC_VERSION GREATER_EQUAL 
1910) — though ANTLR4 itself still won't build there.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to