diff --git a/CMakeLists.txt b/CMakeLists.txt index fd41fa7148..a0710834bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,6 +287,10 @@ option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF) option(WITH_METRICS_EXEMPLAR_PREVIEW "Whether to enable exemplar within metrics" OFF) +option(OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS + "Whether to build test libraries that are always linked as shared libs" + OFF) + # # Verify options dependencies # diff --git a/api/test/CMakeLists.txt b/api/test/CMakeLists.txt index 20c9f4e949..66eeee2092 100644 --- a/api/test/CMakeLists.txt +++ b/api/test/CMakeLists.txt @@ -10,4 +10,7 @@ add_subdirectory(metrics) add_subdirectory(logs) add_subdirectory(common) add_subdirectory(baggage) -add_subdirectory(singleton) + +if(NOT OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS) + add_subdirectory(singleton) +endif() diff --git a/examples/plugin/CMakeLists.txt b/examples/plugin/CMakeLists.txt index e1a44690e4..5dfc79963c 100644 --- a/examples/plugin/CMakeLists.txt +++ b/examples/plugin/CMakeLists.txt @@ -2,4 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 add_subdirectory(load) -add_subdirectory(plugin) + +if(NOT OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS) + add_subdirectory(plugin) +endif()