Исправил подключение natvis файла при сборке с генератором Visual Studio

This commit is contained in:
Aleksandr Orefkov 2025-11-20 14:13:41 +03:00
parent 5b81228a03
commit 6905c9bb76
3 changed files with 14 additions and 17 deletions

View File

@ -5,7 +5,7 @@ include(FetchContent)
project(
simstr
VERSION 1.2.4
VERSION 1.2.5
DESCRIPTION "Yet another string library"
HOMEPAGE_URL "https://github.com/orefkov/simstr"
LANGUAGES CXX
@ -48,20 +48,17 @@ if(EMSCRIPTEN)
endif()
endif(EMSCRIPTEN)
if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
if (NOT CMAKE_CXX_SIMULATE_ID)
set (CMAKE_CXX_SIMULATE_ID "None")
endif()
# Для MSVC подключаем natvis файл для красивой отладки
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR ${CMAKE_CXX_SIMULATE_ID} STREQUAL MSVC)
add_custom_command(
TARGET simstr_simstr PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/for_debug/simstr.natvis
${CMAKE_CURRENT_BINARY_DIR}/simstr.natvis
)
target_link_options(simstr_simstr PUBLIC "/natvis:simstr.natvis")
endif()
message("Configuring simstr for [${CMAKE_BUILD_TYPE}]")
# Для MSVC подключаем natvis файл для красивой отладки
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC ")
add_custom_command(
TARGET simstr_simstr PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/for_debug/simstr.natvis
${CMAKE_BINARY_DIR}/simstr.natvis
)
target_link_options(simstr_simstr PUBLIC "/natvis:${CMAKE_BINARY_DIR}/simstr.natvis")
endif()
set_target_properties(

View File

@ -1,7 +1,7 @@
# simstr - String object and function library
[![CMake on multiple platforms](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml)
Version 1.2.4.
Version 1.2.5.
<span class="obfuscator"><a href="readme_ru.md">On Russian | По-русски</a></span>

View File

@ -1,7 +1,7 @@
# simstr - библиотека строковых объектов и функций
[![CMake on multiple platforms](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/orefkov/simstr/actions/workflows/cmake-multi-platform.yml)
Версия 1.2.4.
Версия 1.2.5.
<span class="obfuscator"><a href="readme.md">On English | По-английски</a></span>