Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set set correct defaults (c++ 11) as a public property #1338

Closed
dblock opened this issue Mar 5, 2020 · 2 comments
Closed

Set set correct defaults (c++ 11) as a public property #1338

dblock opened this issue Mar 5, 2020 · 2 comments
Labels
closed-for-staleness feature-request

Comments

@dblock
Copy link
Contributor

@dblock dblock commented Mar 5, 2020

What platform/OS are you using?

MacOS

Which version of the SDK?

Mojave

What compiler are you using? what version?

CMake 3.16.4

Coming from awsdocs/aws-doc-sdk-examples#1022 (comment)

Currently projects require setting the target compile features to C++ 11 in CMakeLists.txt with target_compile_features(my-example PUBLIC cxx_std_11) or risk getting the following errors:

[ 50%] Building CXX object CMakeFiles/list-s3-buckets.dir/main.cpp.o
In file included from /Users/dblock/source/aws-sdk/list-s3-buckets/main.cpp:2:
In file included from /usr/local/include/aws/core/Aws.h:17:
In file included from /usr/local/include/aws/core/utils/logging/LogLevel.h:20:
In file included from /usr/local/include/aws/core/utils/memory/stl/AWSString.h:20:
In file included from /usr/local/include/aws/core/utils/memory/stl/AWSAllocator.h:21:
/usr/local/include/aws/core/utils/memory/AWSMemory.h:162:78: error: 'T' does not refer to a value
            std::size_t headerSize = (std::max)(sizeof(std::size_t), alignof(T));
                                                                             ^
/usr/local/include/aws/core/utils/memory/AWSMemory.h:149:23: note: declared here
    template<typename T>
                      ^

There should be a way to not have to do this for every project.

@Lectem
Copy link

@Lectem Lectem commented Mar 5, 2020

Note that it would require to have at least one exported target to have this compile feature requirement.

It should either be used (transitively) for all targets that get installed or it could be handled by the https://github.com/aws/aws-sdk-cpp/blob/master/cmake/AWSSDKConfig.cmake file.
Since it already iterates over targets it could probably call target_compile_features for each of them ?

It already tries to do something with a hardcoded CPP_STANDARD

set(CPP_STANDARD "11" CACHE STRING "Flag to upgrade the C++ standard used. The default is 11. The minimum is 11.")
that knows how to set the standard only for gcc/linux (see
list(APPEND AWS_COMPILER_FLAGS "-fno-exceptions" "-std=c++${CPP_STANDARD}")
and
list(APPEND CMAKE_REQUIRED_FLAGS "-std=c++${CPP_STANDARD}")
)

@KaibaLopez KaibaLopez added the feature-request label Mar 6, 2020
@github-actions
Copy link

@github-actions github-actions bot commented Mar 7, 2021

Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.

@github-actions github-actions bot added closing-soon closed-for-staleness and removed closing-soon labels Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness feature-request
Projects
None yet
Development

No branches or pull requests

3 participants