mirror of https://github.com/orefkov/simstr.git
Add optional natvis link
This commit is contained in:
parent
1301597229
commit
bca4664d1a
|
|
@ -21,8 +21,13 @@ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
|
||||||
set(CLANG_COMPILER ON)
|
set(CLANG_COMPILER ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(SIMSTR_BUILD_TESTS "Построить тесты" ON)
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC ")
|
||||||
option(SIMSTR_BENCHMARKS "Построить замеры производительности" Off)
|
set(CAN_LINK_NATVIS On)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(SIMSTR_BUILD_TESTS "Build tests" ON)
|
||||||
|
option(SIMSTR_BENCHMARKS "Build benchmarks" Off)
|
||||||
|
cmake_dependent_option(SIMSTR_LINK_NATVIS "Link natvis file" On CAN_LINK_NATVIS Off)
|
||||||
|
|
||||||
add_library(simstr_simstr
|
add_library(simstr_simstr
|
||||||
src/sstring.cpp
|
src/sstring.cpp
|
||||||
|
|
@ -50,15 +55,17 @@ endif(EMSCRIPTEN)
|
||||||
|
|
||||||
message("Configuring simstr for [${CMAKE_BUILD_TYPE}]")
|
message("Configuring simstr for [${CMAKE_BUILD_TYPE}]")
|
||||||
|
|
||||||
# Для MSVC подключаем natvis файл для красивой отладки
|
if (SIMSTR_LINK_NATVIS)
|
||||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC ")
|
# Для MSVC подключаем natvis файл для красивой отладки
|
||||||
add_custom_command(
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC ")
|
||||||
TARGET simstr_simstr PRE_BUILD
|
add_custom_command(
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
TARGET simstr_simstr PRE_BUILD
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/for_debug/simstr.natvis
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
${CMAKE_BINARY_DIR}/simstr.natvis
|
${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")
|
)
|
||||||
|
target_link_options(simstr_simstr PUBLIC "/natvis:${CMAKE_BINARY_DIR}/simstr.natvis")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue