diff --git a/cmake/external/abseil-cpp.cmake b/cmake/external/abseil-cpp.cmake index 816f0ab53e..cefc65f28e 100644 --- a/cmake/external/abseil-cpp.cmake +++ b/cmake/external/abseil-cpp.cmake @@ -13,6 +13,10 @@ else() set(ABSL_PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${PROJECT_SOURCE_DIR}/patches/abseil/Fix_Nvidia_Build_Break.patch) endif() +# NB! Advancing Abseil version changes its internal namespace, +# currently absl::lts_20211102 which affects abseil-cpp.natvis debugger +# visualization file, that must be adjusted accordingly, unless we eliminate +# that namespace at build time. FetchContent_Declare( abseil_cpp PREFIX "${CMAKE_CURRENT_BINARY_DIR}/abseil-cpp" diff --git a/tools/natvis/abseil-cpp.natvis b/cmake/external/abseil-cpp.natvis similarity index 82% rename from tools/natvis/abseil-cpp.natvis rename to cmake/external/abseil-cpp.natvis index ed5ef413af..c9f3a93f24 100644 --- a/tools/natvis/abseil-cpp.natvis +++ b/cmake/external/abseil-cpp.natvis @@ -1,12 +1,12 @@ - - {{ size={storage_.metadata_.value >> 1} }} + + {{ size={ storage_.metadata_.value >> 1 } }} - $T2 $T2 storage_.data_.allocated.allocated_capacity - storage_.metadata_ + $T2 + storage_.metadata_ storage_.metadata_.value >> 1 (($T1 &)(storage_.data_.inlined.inlined_data[$i])) @@ -18,7 +18,7 @@ - + empty {{ size={size_} }} @@ -38,7 +38,7 @@ - + {{ {value.first}:{value.second} }} value.first diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake index a8ca9c9254..c0defbadc1 100644 --- a/cmake/onnxruntime_common.cmake +++ b/cmake/onnxruntime_common.cmake @@ -110,6 +110,13 @@ endif() if(NOT onnxruntime_DISABLE_ABSEIL) include(external/abseil-cpp.cmake) + if (MSVC) + set(ABSEIL_NATVIS_FILE "abseil-cpp.natvis") + target_sources( + onnxruntime_common + INTERFACE $ + ) + endif() endif() onnxruntime_add_include_to_target(onnxruntime_common date_interface wil)