From c81cc34d72b823e2fc527169da8299dd25899c11 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 7 Sep 2022 11:06:50 +0200 Subject: [PATCH] Partial revert of: commit 74ec691e4a73c3160f2bb2aaf0a9626fb282beec Author: WenTao Ou Date: Thu Apr 7 14:06:59 2022 +0800 Move public definitions into `opentelemetry_api`. (#1314) Signed-off-by: owent When using WITH_STL in cmake, HAVE_CPP_STDLIB must be defined for unit tests. --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1b6934003..a94bf14a2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,9 +127,12 @@ endif() if(WITH_STL) # These definitions are needed for test projects that do not link against - # opentelemetry-api library directly. We ensure that variant implementation - # (absl::variant or std::variant) in variant unit test code is consistent with - # the global project build definitions. Optimize for speed to reduce the hops + # opentelemetry-api library directly. We ensure that STL implementation + # (nostd:: or std::) in unit test code is consistent with + # the global project build definitions. + add_definitions(-DHAVE_CPP_STDLIB) + + # Optimize for speed to reduce the hops if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_BUILD_TYPE MATCHES Debug) # Turn off optimizations for DEBUG