From bc99dfcd68addb8c7676c927c605382ed29a432a Mon Sep 17 00:00:00 2001 From: Julio Gonzalez Date: Mon, 19 Aug 2024 13:04:37 +0200 Subject: [PATCH] [WIP] Debug windows static compilation. --- examples/ffi/CMakeLists.txt | 5 +++-- examples/ffi/trace_exporter.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/ffi/CMakeLists.txt b/examples/ffi/CMakeLists.txt index b7b715074..154a1340d 100644 --- a/examples/ffi/CMakeLists.txt +++ b/examples/ffi/CMakeLists.txt @@ -11,13 +11,13 @@ function(set_vcruntime_link_type binary link_type) if (link_type STREQUAL "DLL") set_property(TARGET ${binary} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") else() - set_property(TARGET ${binary} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + set_property(TARGET ${binary} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() endif() endfunction() # Uncomment to debug build commands -# set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_VERBOSE_MAKEFILE ON) add_executable(exporter exporter.cpp) # needed for designated initializers @@ -32,6 +32,7 @@ target_link_libraries(crashinfo PRIVATE Datadog::Profiling) if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") target_compile_definitions(exporter PUBLIC _CRT_SECURE_NO_WARNINGS) endif() diff --git a/examples/ffi/trace_exporter.c b/examples/ffi/trace_exporter.c index c8cfb9993..2dd351ccf 100644 --- a/examples/ffi/trace_exporter.c +++ b/examples/ffi/trace_exporter.c @@ -1,10 +1,10 @@ // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 -#include -#include #include #include +#include +#include #define TRY(expr) \ { \