aws-sdk-cpp
aws-sdk-cpp copied to clipboard
Unable to set C++ Language Standard from cmake
Describe the bug
CPP_STANDARD macro does not perform its function for v1.9.350
Expected Behavior
C++ Language Standard property for all projects should be set to ISO C++17 Standard (/std:c++17) when set from CMake
Current Behavior
C++ Language Standard is set to default
Reproduction Steps
Here is the CMake command I used:
cmake ..\aws-sdk-cpp\ -DBUILD_ONLY="s3;s3-crt" -DBUILD_SHARED_LIBS=OFF -DCPP_STANDARD=17 -DTARGET_ARCH=WINDOWS -G "Visual Studio 15 Win64" -DENABLE_TESTING=OFF
Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
v1.9.350
Compiler and Version used
Visual Studio
Operating System and version
Windows 11
Are you getting an error in visual studio? or is it just saying that you are not using c++17?
I am unable to use the C++17-specific function. like std::byte (namespace std has no member "byte") I think it is built in C++ 11 (Default Version)
Our API is not designed to support std::byte or other C++14/17/20 types, you will need to implement wrappers/type convertors should you want to pass a std::byte to the CPP SDK. Enabling CPP 17 standard may allow you to instantiate/pass C++17-level code into the CPP SDK apis that accept user templates or fabric functions. However, you should be able to do it even now, cause this code is in fact is a part of your application using the SDK and baked in (i.e. compiled and linked) into your binary.
You may also want to build C++ SDK using CPP 17 standard to have unified runtime and minimize STD library ABI compatibility issues, still the SDK code will be within C++11 standard level. Did you have any more questions about using this sdk?
Then what is the use of the macro CPP_STANDARD if SDK does not support C++ 14/17/20? I manually set C++ 17 as the language standard and was able to use C++17-specific types. So, shouldn't setting macro should set all CPP projects standard as 17
We don't provide a c++ 17 specific interface but you can compile under c++ 17 standard. As you noticed you can use the cmake command to set the cpp_standard, but this doesn't mean that this sdk with support c++ 17 types.