Describe the bug
When building with following parameters to CMake:
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DBUILD_ONLY=s3;s3-crt
-DBUILD_SHARED_LIBS=OFF
-DCPP_STANDARD=17
-DCUSTOM_MEMORY_MANAGEMENT=ON
-DENABLE_TESTING=OFF
-DFORCE_SHARED_CRT=OFF
-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=ON
I get:
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\JsonTraits.h(24,46): error C2220: the following warning is treated as an error [C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\out\x64\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
09:53:34 (compiling source file '../../../../lib/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp')
09:53:34
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\JsonTraits.h(24,46): warning C4275: non dll-interface class 'smithy::schema::TraitKeyBase' used as base for dll-interface class 'smithy::schema::TraitKey<smithy::schema::JsonNameTrait>' [C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\out\x64\src\aws-cpp-sdk-core\aws-cpp-sdk-core.vcxproj]
09:53:34 (compiling source file '../../../../lib/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp')
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\TraitKey.h(7,18):
09:53:34 see declaration of 'smithy::schema::TraitKeyBase'
09:53:34 C:\Jws\qix-pc3-build-ws\build\aws-sdk-cpp\lib\src\aws-cpp-sdk-core\include\smithy\client\schema\JsonTraits.h(24,46):
09:53:34 see declaration of 'smithy::schema::TraitKey<smithy::schema::JsonNameTrait>'
Regression Issue
Expected Behavior
It compiled in 1.11.817
Current Behavior
Build with:
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>
-DBUILD_ONLY=s3;s3-crt
-DBUILD_SHARED_LIBS=OFF
-DCPP_STANDARD=17
-DCUSTOM_MEMORY_MANAGEMENT=ON
-DENABLE_TESTING=OFF
-DFORCE_SHARED_CRT=OFF
-DAWS_STATIC_MSVC_RUNTIME_LIBRARY=ON
And you get the compilation error.
Reproduction Steps
See above.
Possible Solution
diff --git a/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp b/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp
index dff0c2f99..5ea4b7a27 100644
--- a/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp
+++ b/src/aws-cpp-sdk-core/source/smithy/client/schema/TraitKey.cpp
@@ -22,7 +22,7 @@ const TraitKey<T>& TraitKey<T>::Instance() {
return instance;
}
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && defined(USE_IMPORT_EXPORT)
#define SMITHY_TEMPLATE_EXPORT __declspec(dllexport)
#else
#define SMITHY_TEMPLATE_EXPORT
--
2.49.0
Additional Information/Context
No response
AWS CPP SDK version used
1.11.895
Compiler and Version used
MSVC 19.41.34120.0
Operating System and version
Windows 11
Describe the bug
When building with following parameters to CMake:
I get:
Regression Issue
Expected Behavior
It compiled in 1.11.817
Current Behavior
Build with:
And you get the compilation error.
Reproduction Steps
See above.
Possible Solution
Additional Information/Context
No response
AWS CPP SDK version used
1.11.895
Compiler and Version used
MSVC 19.41.34120.0
Operating System and version
Windows 11