Skip to content

Commit

Permalink
[BUILD] Add a CMake option to disable shared libs (#3095)
Browse files Browse the repository at this point in the history
* Add a CMake option to disable shared libs

This option is useful to support platforms that do not support
dynamic libraries and `dlopen`.
  • Loading branch information
tobim authored Oct 21, 2024
1 parent b1488cd commit 7402ed9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
5 changes: 4 additions & 1 deletion api/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
5 changes: 4 additions & 1 deletion examples/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 7402ed9

Please sign in to comment.