otel
parent
baa5952666
commit
0fed009bdf
|
@ -12,6 +12,8 @@ option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF)
|
|||
option(ENABLE_UBSAN "Enable the ub sanitizer" OFF)
|
||||
option(ENABLE_TSAN "Enable the thread data race sanitizer" OFF)
|
||||
|
||||
option(BLT_DEBUG_OTEL "Enable OpenTelemetry Service" OFF)
|
||||
|
||||
option(BUILD_STD "Build the BLT standard utilities." ON)
|
||||
option(BUILD_PROFILING "Build the BLT profiler extension" ON)
|
||||
option(BUILD_FS "Build the BLT FS utilities including the NBT + eNBT extension" ON)
|
||||
|
@ -29,6 +31,22 @@ option(BLT_DISABLE_WARN "Disable blt::logging BLT_WARN macro" OFF)
|
|||
option(BLT_DISABLE_ERROR "Disable blt::logging BLT_ERROR macro" OFF)
|
||||
option(BLT_DISABLE_FATAL "Disable blt::logging BLT_FATAL macro" OFF)
|
||||
|
||||
if (BLT_DEBUG_OTEL)
|
||||
set(WITH_BENCHMARK OFF)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(WITH_ABSEIL OFF)
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
opentelemtry-cpp
|
||||
GIT_REPOSITORY https://github.com/open-telemetry/opentelemetry-cpp
|
||||
GIT_TAG 6175aa0b213eea053247e43b4f35b8d201fa356e # release-1.20.0
|
||||
)
|
||||
FetchContent_MakeAvailable(opentelemtry-cpp)
|
||||
|
||||
message("${OPENTELEMETRY_CPP_LIBRARIES}")
|
||||
# include_directories("${opentelemtry-cpp_INCLUDE_DIRS}")
|
||||
endif ()
|
||||
|
||||
if(${BLT_DISABLE_STATS})
|
||||
add_compile_definitions(BLT_DISABLE_STATS)
|
||||
endif ()
|
||||
|
@ -200,3 +218,7 @@ if (${BUILD_TESTS})
|
|||
endif ()
|
||||
|
||||
project(BLT)
|
||||
|
||||
if (BLT_DEBUG_OTEL)
|
||||
target_link_libraries(${BLT_TARGET} PUBLIC ${OPENTELEMETRY_CPP_LIBRARIES})
|
||||
endif ()
|
|
@ -0,0 +1,21 @@
|
|||
{ pkgs ? (import <nixpkgs> {
|
||||
config.allowUnfree = true;
|
||||
config.segger-jlink.acceptLicense = true;
|
||||
}), ... }:
|
||||
pkgs.mkShell
|
||||
{
|
||||
buildInputs = with pkgs; [
|
||||
cmake
|
||||
gcc
|
||||
clang
|
||||
emscripten
|
||||
ninja
|
||||
renderdoc
|
||||
valgrind
|
||||
];
|
||||
propagatedBuildInputs = with pkgs; [
|
||||
gtest
|
||||
gtest.dev
|
||||
];
|
||||
LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib";
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
/*
|
||||
* Copyright (C) 2024 Brett Terpstra
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef BLT_DEFINES_H
|
||||
#define BLT_DEFINES_H
|
||||
|
||||
#if defined(BLT_DEBUG_OTEL) && defined(__has_include) &&__has_include(<opentelemetry/version.h>)
|
||||
#define BLT_DEBUG_OTEL_ENABLED 1
|
||||
#endif
|
||||
|
||||
#endif //BLT_DEFINES_H
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <blt/std/defines.h>
|
||||
|
||||
#ifndef NO_BLT_NAMESPACE_ON_TYPES
|
||||
namespace blt
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit d88c5e15079047777b418132ece5879e7c9aaa2b
|
||||
Subproject commit 8a889d3699b3c09ade435641fb034427f3fd12b6
|
Loading…
Reference in New Issue