-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Generate pkg-config contains spurious cflags #2673
Comments
Also, since the AWS C++ SDK depends internally on |
Reading again the CMake macro that generates variables for the pkg-config file, I think the whole part that sets GCC flags should be removed. |
I would propose the following changes:
With these two changes, the build and installation of a fresh AWS CPP SDK now generate a proper pkg-config file, as showcased:
|
Hello @NewbiZ , Thank you very much for your detailed submission. We really appreciate your feedback and contribution. This request falls under the Improvement to build, install, and distribution mechanisms project. We will discuss it as a team as part of this project and decide on implementation and prioritization based on user impact and benefits. Thank you very much again for your collaboration and for all the details provided. Sincerely, Yasmine |
@jmklix @yasminetalby I believe this to be a bug rather than a feature request as it breaks dependent projects if they happen to use exceptions. Please review the tags if possible and consider re-prioritizing. |
Describe the bug
Context
pkg-config
is a Unix tool that allows easy retrieval of compiler and linker flags of dependencies. It relies on.pc
files installed in a standard location, and a utility to query flags from your build system.Issue
The currently generated pkg-config file contains spurious compiler and linker flags that are not meant for users of the library, but rather are a dump of what was used to build the SDK itself.
Expected Behavior
I would expect the following compiler flags for e.g. an S3-only build:
And the following linker flags:
Current Behavior
It seems the current build toolchain just dumps its own build flags in the pkg-config file, instead of the build flags that users of the SDK should use, which means we end up with:
More precisly, after an S3-only build, here is the output of pkg-config:
-fno-exceptions
is an implementation choice of the AWS C++ SDK which should not leak to the users of the SDK. Linking exception-aware code with the SDK should be allowed (just as linking with C code from C++ is allowed).-std=c++11
is also an implementation choice of the SDK that should not leak to its users. Using the SDK from a C++ 14 / 17 / 20 / 23 codebase should be supported.-Iinclude
is a build-relative path used when building the SDK, it has nothing to do with how users should include the SDK. One can even imagine scenarios where not only this path is useless, but it could also incorrectly include a random directory in users builds.Reproduction Steps
Any regular build will showcase the incorrect behavior:
Possible Solution
-std=c++11
and-fno-exceptions
) here:aws-sdk-cpp/cmake/compiler_settings.cmake
Line 23 in 197a6df
@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
or something like that) here:aws-sdk-cpp/toolchains/pkg-config.pc.in
Line 1 in 197a6df
Additional Information/Context
No response
AWS CPP SDK version used
Any
Compiler and Version used
Any
Operating System and version
Any linux
The text was updated successfully, but these errors were encountered: