-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (42 loc) · 1.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
idf_component_register()
# This is a arch which doesn't affect opentelemetry-cpp lib
# but it helps to pass through the checks of root CMakeLists.txt
set(CMAKE_SYSTEM_PROCESSOR riscv)
option(WITH_STL CXX23)
set(WITH_STL CXX23)
option(CMAKE_POSITION_INDEPENDENT_CODE FALSE)
option(WITH_ZIPKIN OFF)
option(BUILD_TESTING OFF)
option(WITH_OTLP_GRPC OFF)
option(WITH_OTLP_HTTP OFF)
option(BUILD_SHARED_LIBS OFF)
option(WITH_EXAMPLES OFF)
# This is necessery to skip linking resolution to second pthread-lib (yes, esp-idf contains 2)
# and to avoid conflict of names when both libs are linked.
# Here we define stub to pthread_atfork() which does nothing useful for us:
# it is intended to reseed RNG in new forked events. And since we
# dont have MMU and processes we assume forks are impossible,
# so we can stab this one pthread call (which is not implemented in ESP-iDF) with stub.
add_library(pthread_stubs src/pthread_stubs.c)
set(CMAKE_PREFIX_PATH_ORIG "${CMAKE_PREFIX_PATH}")
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_PREFIX_PATH}")
add_subdirectory(opentelemetry-cpp)
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH_ORIG}")
set(Thread_FOUND FALSE)
# Include everything except for opentelemetry_api target
target_link_libraries(${COMPONENT_LIB} INTERFACE
opentelemetry_sdk
opentelemetry_common
opentelemetry_trace
opentelemetry_metrics
opentelemetry_logs
opentelemetry_version
opentelemetry_resources
opentelemetry_ext
opentelemetry_exporter_ostream_span
opentelemetry_exporter_ostream_metrics
opentelemetry_exporter_ostream_logs
opentelemetry_exporter_in_memory
opentelemetry_exporter_in_memory_metric
)
# The one left target (opentelemetry_api) will be pulled by opentelemetry_api component