diff --git a/CHANGELOG.md b/CHANGELOG.md index a6f91d0b50..489a314255 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ Increment the: ## [Unreleased] +* [BUILD] Error out when building DLL without MSVC + [#3438](https://github.com/open-telemetry/opentelemetry-cpp/pull/3438) + * [Metrics SDK] Use nostd::function_ref in AttributesHashMap [#3393](https://github.com/open-telemetry/opentelemetry-cpp/pull/3393) diff --git a/ext/src/CMakeLists.txt b/ext/src/CMakeLists.txt index 65aaa307c0..b3d45a719d 100644 --- a/ext/src/CMakeLists.txt +++ b/ext/src/CMakeLists.txt @@ -5,6 +5,6 @@ if(WITH_HTTP_CLIENT_CURL) add_subdirectory(http/client/curl) endif() -if(MSVC AND DEFINED OPENTELEMETRY_BUILD_DLL) +if(DEFINED OPENTELEMETRY_BUILD_DLL) add_subdirectory(dll) endif() diff --git a/ext/src/dll/CMakeLists.txt b/ext/src/dll/CMakeLists.txt index 4eb953b154..d5c273c83a 100644 --- a/ext/src/dll/CMakeLists.txt +++ b/ext/src/dll/CMakeLists.txt @@ -1,6 +1,12 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +if(NOT MSVC) + message( + FATAL_ERROR + "The OpenTelemetry C++ SDK for Windows DLL is only supported on MSVC.") +endif() + set(OPENTELEMETRY_EXPORT_DEF "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry_cpp.def")