diff --git a/flex/CMakeLists.txt b/flex/CMakeLists.txt index c0385658cec2..16e6476230af 100644 --- a/flex/CMakeLists.txt +++ b/flex/CMakeLists.txt @@ -16,6 +16,7 @@ option(BUILD_ODPS_FRAGMENT_LOADER "Whether to build odps fragment loader" OFF) option(USE_PTHASH "Whether to use pthash" OFF) option(OPTIMIZE_FOR_HOST "Whether to optimize on host" ON) # Whether to build optimized code on host option(USE_STATIC_ARROW "Whether to use static arrow" ON) # Whether to link arrow statically, default is ON +option(ENABLE_OTEL "Whether to enable otel" OFF) #print options message(STATUS "Build test: ${BUILD_TEST}") @@ -164,14 +165,16 @@ endif () find_package(Protobuf REQUIRED) include_directories(${Protobuf_INCLUDE_DIRS}) -find_package(opentelemetry-cpp CONFIG) -if (OPENTELEMETRY_CPP_FOUND) - message(STATUS "opentelemetry-cpp found") - find_package(CURL REQUIRED) - add_definitions(-DHAVE_OPENTELEMETRY_CPP) -else() - message(STATUS "opentelemetry-cpp not found, build without opentelemetry-cpp") -endif () +if (ENABLE_OTEL) + find_package(opentelemetry-cpp CONFIG) + if (OPENTELEMETRY_CPP_FOUND) + message(STATUS "opentelemetry-cpp found") + find_package(CURL REQUIRED) + add_definitions(-DHAVE_OPENTELEMETRY_CPP) + else() + message(STATUS "opentelemetry-cpp not found, build without opentelemetry-cpp") + endif () +endif() # Find Doxygen if (BUILD_DOC)