From e1104c79f1405764a827ae0b19d6072eb9cb7276 Mon Sep 17 00:00:00 2001 From: Donghyeon Jeong Date: Fri, 5 Dec 2025 10:31:44 +0900 Subject: [PATCH] Meson: Force _ITERATOR_DEBUG_LEVEL=2 for Meson debug builds on Windows This PR addresses known Meson limitations in applying b_vscrt settings for clang++.exe in C++ builds. This ensures debug behavior matches Visual Studio Debug configurations when using buildtype=debug. **Self-evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Donghyeon Jeong --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 7f65cea49a..e2f5d015eb 100644 --- a/meson.build +++ b/meson.build @@ -14,6 +14,12 @@ project('nntrainer', 'c', 'cpp', cmake_build_type = 'Release' if get_option('buildtype') == 'debug' cmake_build_type = 'Debug' + # Meson currently has known issues applying b_vscrt properly for clang++.exe on Windows + # Just setting buildtype=debug may not switch the CRT or iterator level. + # Therefore, forcing _ITERATOR_DEBUG_LEVEL=2 for Meson debug build to match VS Debug + if build_machine.system() == 'windows' + add_project_arguments('-D_ITERATOR_DEBUG_LEVEL=2', language : 'cpp') + endif endif common_win_subproject_cmake_defines = {