PragmaTwice commented on code in PR #5195:
URL: https://github.com/apache/opendal/pull/5195#discussion_r1804474181


##########
bindings/cpp/CMakeLists.txt:
##########
@@ -34,6 +31,18 @@ option(OPENDAL_ENABLE_DOCUMENTATION "Enable generating 
document for opendal" OFF
 option(OPENDAL_DOCS_ONLY "Only build documentation (dev only for quick ci)" 
OFF)
 option(OPENDAL_ENABLE_TESTING "Enable building test binary for opendal" OFF)
 option(OPENDAL_DEV "Enable dev mode" OFF)
+option(OPENDAL_ENABLE_ASYNC "Enable async mode (requires C++20)" OFF)
+
+if(OPENDAL_ENABLE_ASYNC)
+    set(CMAKE_CXX_STANDARD 20)
+
+    if (NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR 
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")))
+        message(FATAL_ERROR "currently C++ compiler must be clang for async 
mode")
+    endif()
+else()
+    set(CMAKE_CXX_STANDARD 17)

Review Comment:
   Yeah it can be C++20.
   
   Regarding to whether to make async an optional feature, I think currently 
(due to some problems inside cxx-async) some compilers (with lower versions) 
cannot compile it successfully, also users may face some other build problems 
currently, so we can make it optional at beginning and change it to a default 
feature in the future when this part becomes more stable. Hence currently we 
can leave the default part C++17.



-- 
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