You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "devillove084 (via GitHub)" <gi...@apache.org> on 2025/05/30 13:45:22 UTC
Re: [PR] feat(bindings/cpp): tweak settings to support build opendal_cpp in windows [opendal]
devillove084 commented on code in PR #6231:
URL: https://github.com/apache/opendal/pull/6231#discussion_r2115046662
##########
bindings/cpp/CMakeLists.txt:
##########
@@ -42,14 +42,11 @@ 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()
Review Comment:
We still need to require C++17, because many projects cannot directly support C++20 for the time being, and it is necessary to retain this practice.
##########
bindings/cpp/CMakeLists.txt:
##########
@@ -171,7 +170,7 @@ endif()
# Platform-specific test configuration
if(WIN32)
- target_link_libraries(opendal_cpp userenv ws2_32 bcrypt)
+ target_link_libraries(opendal_cpp PRIVATE userenv ws2_32 bcrypt Ntdll.lib)
Review Comment:
System libraries (such as userenv/ws2_32) should use PUBLIC, as they are interface dependencies, while internal libraries (Ntdll.lib) should use PRIVATE.
##########
bindings/cpp/CMakeLists.txt:
##########
@@ -83,7 +80,9 @@ endif()
execute_process(COMMAND cargo locate-project --workspace --message-format plain
Review Comment:
Additionally, I am considering whether we can first simply add a CI for Windows platform compilation and C++ unit test execution, so as to initially and easily ensure that compilation changes are reliable.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org