Skip to content

Commit c2ea734

Browse files
authored
[BUILD] Error out when building DLL without MSVC (open-telemetry#3438)
1 parent 4b6f52a commit c2ea734

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Increment the:
1515

1616
## [Unreleased]
1717

18+
* [BUILD] Error out when building DLL without MSVC
19+
[#3438](https://github.com/open-telemetry/opentelemetry-cpp/pull/3438)
20+
1821
* [Metrics SDK] Use nostd::function_ref in AttributesHashMap
1922
[#3393](https://github.com/open-telemetry/opentelemetry-cpp/pull/3393)
2023

ext/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ if(WITH_HTTP_CLIENT_CURL)
55
add_subdirectory(http/client/curl)
66
endif()
77

8-
if(MSVC AND DEFINED OPENTELEMETRY_BUILD_DLL)
8+
if(DEFINED OPENTELEMETRY_BUILD_DLL)
99
add_subdirectory(dll)
1010
endif()

ext/src/dll/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4+
if(NOT MSVC)
5+
message(
6+
FATAL_ERROR
7+
"The OpenTelemetry C++ SDK for Windows DLL is only supported on MSVC.")
8+
endif()
9+
410
set(OPENTELEMETRY_EXPORT_DEF
511
"${CMAKE_CURRENT_BINARY_DIR}/opentelemetry_cpp.def")
612

0 commit comments

Comments
 (0)