bug: cpp bindings can not be compiled in windows
Describe the bug
- c++ standard mismatch
Currently c++ 17 is used at
https://github.com/apache/opendal/blob/193a30ec111ec4379b0124a58b63692d018773dc/bindings/cpp/CMakeLists.txt#L51
But Designated Initializers is c++ 20 feature.
https://github.com/apache/opendal/blob/193a30ec111ec4379b0124a58b63692d018773dc/bindings/cpp/src/operator.cpp#L38 https://github.com/apache/opendal/blob/193a30ec111ec4379b0124a58b63692d018773dc/bindings/cpp/src/utils/ffi_converter.cpp#L25
target_link_librariesissue
On windows platform, some extra depdencies are linked to target using plain-style (without PRIVATE or PUBLIC)
https://github.com/apache/opendal/blob/193a30ec111ec4379b0124a58b63692d018773dc/bindings/cpp/CMakeLists.txt#L174
But there exist several keyword-style linking.
https://github.com/apache/opendal/blob/193a30ec111ec4379b0124a58b63692d018773dc/bindings/cpp/CMakeLists.txt#L174
Using both plain and keyword for the same target is not allowed in cmake
pathissue
Regular expression is used to handle path at
https://github.com/apache/opendal/blob/193a30ec111ec4379b0124a58b63692d018773dc/bindings/cpp/CMakeLists.txt#L86
On windows platform, the line terminator can be \r\n. Therefore this regex may generate wrong result with unexpected \r
Steps to Reproduce
Compiling the cpp bindings sample can reproduce this problem
Expected Behavior
cpp bindings sample should be compiled properly.
Additional Context
No response
Are you willing to submit a PR to fix this bug?
- [x] Yes, I would like to submit a PR.
I have recently received several reports about the opendal C++ binding on Windows. It might be time for us to introduce Windows CI support for C++.