Skip to content

Commit 7402ed9

Browse files
authored
[BUILD] Add a CMake option to disable shared libs (open-telemetry#3095)
* Add a CMake option to disable shared libs This option is useful to support platforms that do not support dynamic libraries and `dlopen`.
1 parent b1488cd commit 7402ed9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF)
287287
option(WITH_METRICS_EXEMPLAR_PREVIEW
288288
"Whether to enable exemplar within metrics" OFF)
289289

290+
option(OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS
291+
"Whether to build test libraries that are always linked as shared libs"
292+
OFF)
293+
290294
#
291295
# Verify options dependencies
292296
#

api/test/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ add_subdirectory(metrics)
1010
add_subdirectory(logs)
1111
add_subdirectory(common)
1212
add_subdirectory(baggage)
13-
add_subdirectory(singleton)
13+
14+
if(NOT OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS)
15+
add_subdirectory(singleton)
16+
endif()

examples/plugin/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
add_subdirectory(load)
5-
add_subdirectory(plugin)
5+
6+
if(NOT OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS)
7+
add_subdirectory(plugin)
8+
endif()

0 commit comments

Comments
 (0)