OpenTelemetry ApiView fix (#3784)
This commit is contained in:
parent
dc04b2410e
commit
ee36dd3abb
@ -50,4 +50,9 @@ foreach ($incDir in $AllLibIncDirs) {
|
||||
$CmdLine += " -I " + $incDir
|
||||
}
|
||||
|
||||
# Define an _azure_APIVIEW macro so that the public headers that depend on 3rd party headers apply a work around
|
||||
# for declaring 3rd party dependencies in a minimalistic way that is sufficient for the ApiView generation.
|
||||
# Otherwise, ApiView would've been including 3rd party types for review, which is not what we want.
|
||||
$CmdLine += " -D_azure_APIVIEW"
|
||||
|
||||
$CmdLine
|
||||
|
||||
@ -40,6 +40,7 @@ if (BUILD_AZURE_CORE_TRACING_OPENTELEMETRY)
|
||||
|
||||
set(
|
||||
AZURE_CORE_OPENTELEMETRY_HEADER
|
||||
inc/azure/core/tracing/opentelemetry/internal/apiview.hpp
|
||||
inc/azure/core/tracing/opentelemetry/opentelemetry.hpp
|
||||
src/opentelemetry_private.hpp
|
||||
)
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
// This file is supposed to be included only when generating files for ApiView.
|
||||
// All the declarations here are only sufficient for the ApiView generation to not fail.
|
||||
|
||||
namespace opentelemetry {
|
||||
namespace nostd {
|
||||
template <typename> struct shared_ptr
|
||||
{
|
||||
};
|
||||
} // namespace nostd
|
||||
namespace trace {
|
||||
struct TracerProvider;
|
||||
struct Provider
|
||||
{
|
||||
static nostd::shared_ptr<TracerProvider> GetTracerProvider();
|
||||
};
|
||||
} // namespace trace
|
||||
} // namespace opentelemetry
|
||||
@ -4,6 +4,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <azure/core/tracing/tracing.hpp>
|
||||
|
||||
#if defined(_azure_APIVIEW)
|
||||
#include "azure/core/tracing/opentelemetry/internal/apiview.hpp"
|
||||
#else
|
||||
#if defined(_MSC_VER)
|
||||
// The OpenTelemetry headers generate a couple of warnings on MSVC in the OTel 1.2 package, suppress
|
||||
// the warnings across the includes.
|
||||
@ -17,6 +21,7 @@
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace Azure { namespace Core { namespace Tracing { namespace OpenTelemetry {
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user