From 72b1ba42da1ccbb6b9d20390cca7167d8eece7a1 Mon Sep 17 00:00:00 2001 From: Mats Taraldsvik Date: Tue, 2 Jan 2024 13:18:33 +0100 Subject: [PATCH] Update CMakeLists.txt --- ext/src/dll/CMakeLists.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ext/src/dll/CMakeLists.txt b/ext/src/dll/CMakeLists.txt index af94976672..caadfdbfa4 100644 --- a/ext/src/dll/CMakeLists.txt +++ b/ext/src/dll/CMakeLists.txt @@ -4,6 +4,17 @@ set(OPENTELEMETRY_EXPORT_DEF "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry_cpp.def") +add_custom_command( + OUTPUT ${OPENTELEMETRY_EXPORT_DEF} + COMMENT "Generating ${OPENTELEMETRY_EXPORT_DEF} file with explicitly exported symbols from opentelemetry_cpp.src" + COMMAND + ${CMAKE_CXX_COMPILER} + "-D$,;-D>" /EP + ${CMAKE_CURRENT_SOURCE_DIR}/opentelemetry_cpp.src > + ${OPENTELEMETRY_EXPORT_DEF} + DEPENDS ${OPENTELEMETRY_EXPORT_DEF} + COMMAND_EXPAND_LISTS VERBATIM) + add_library(opentelemetry_cpp SHARED dllmain.cc ${OPENTELEMETRY_EXPORT_DEF}) target_compile_definitions(opentelemetry_cpp INTERFACE OPENTELEMETRY_BUILD_IMPORT_DLL) @@ -52,15 +63,6 @@ if(WITH_OTLP_HTTP) PRIVATE opentelemetry_exporter_otlp_http_log) endif() -add_custom_command( - OUTPUT ${OPENTELEMETRY_EXPORT_DEF} - COMMAND - ${CMAKE_CXX_COMPILER} - "-D$,;-D>" /EP - ${CMAKE_CURRENT_SOURCE_DIR}/opentelemetry_cpp.src > - ${OPENTELEMETRY_EXPORT_DEF} - COMMAND_EXPAND_LISTS VERBATIM) - if(OPENTELEMETRY_INSTALL) install( TARGETS opentelemetry_cpp