aws / aws/aws-sdk-cpp

missing debug support when CMAKE_DEBUG_POSTFIX is used in AWSSDKConfig.cmake

Open
#1,830 9 comments 0 reactions 0 assignees View on GitHub
bug Cmake needs-reproduction p2
Dominant language
C++
Stars
2.2k
Forks
1.2k
Avg merge
3d 14h
Merged PRs (30d)
12

Description

Confirm by changing [ ] to [x] below to ensure that it's a bug:
- [x] I've gone though [Developer Guide](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/welcome.html) and [API reference](http://sdk.amazonaws.com/cpp/api/LATEST/index.html)
- [x] I've searched for [previous similar issues](https://github.com/aws/aws-sdk-cpp/issues) and didn't find any solution

**Describe the bug**
A clear and concise description of what the bug is.

The CMAKE_DEBUG_POSTFIX debug property was not taken into account in AWSSDKConfig.cmake when the find_library is used.

The solution to fix this problem is below:
diff --git a/cmake/AWSSDKConfig.cmake b/cmake/AWSSDKConfig.cmake
index 5147335ddc..9ff3a413de 100644
--- a/cmake/AWSSDKConfig.cmake
+++ b/cmake/AWSSDKConfig.cmake
@@ -110,7 +110,7 @@ if (NOT AWSSDK_ROOT_DIR)
endif()

-find_library(AWSSDK_CORE_LIB_FILE aws-cpp-sdk-core
+find_library(AWSSDK_CORE_LIB_FILE aws-cpp-sdk-core${CMAKE_DEBUG_POSTFIX}
"${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}"
"${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}/Debug"
"${AWSSDK_ROOT_DIR}/${AWSSDK_INSTALL_LIBDIR}/${AWSSDK_PLATFORM_PREFIX}/DebugOpt"

**SDK version number**
tag: 1.9.165

**Platform/OS/Hardware/Device**
What are you running the sdk on?
It was compiled on Ubuntu 18.04 host for aarch64 target. it was used cross compilation gcc compiler.

**To Reproduce (observed behavior)**
Steps to reproduce the behavior (please share code)

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs/output**
If applicable, add logs or error output.

CMake Warning at /opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib/cmake/AWSSDK/AWSSDKConfig.cmake:112 (message):

AWSSDK_CORE_LIB_FILE-NOTFOUND/opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib//opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib//Debug/opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib//DebugOpt/opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib//Release/opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib//RelWithDebInfo/opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib//MinSizeRel
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)

CMake Error at /opt/work/devbb/bbsdk/install_dir/lx2-aarch64-linux/opt/bluebox/lib/cmake/AWSSDK/AWSSDKConfig.cmake:131 (message):
AWS SDK for C++ headers found, but we were unable to locate the binaries.
Have you deleted or moved it?

Please make sure header files and binaries are located in INSTALL_ROOT_DIR/INCLUDE_DIR/ and INSTALL_ROOT_DIR/LIB_DIR/[PLATFORM_PREFIX]/[Debug|Config|OtherConfigs]
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)

-- Configuring incomplete, errors occurred!

To enable logging, set the following system properties:

*REMEMBER TO SANITIZE YOUR PERSONAL INFO*

```
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
Aws::InitAPI(options)
```

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.