Skip to content

Commit d589aaa

Browse files
committed
fix(db): apply sanitizer flags to migrator tool
- remove obsolete vix_sanitizers linkage - apply sanitizer flags directly to vix_db - apply sanitizer flags to vix_db_migrator - fix clang sanitizer link failure for db tool
1 parent ceda81d commit d589aaa

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ if (VIX_DB_BUILD_TOOLS)
280280
target_link_libraries(vix_db_migrator PRIVATE vix::db)
281281
target_compile_features(vix_db_migrator PRIVATE cxx_std_20)
282282

283+
if (COMMAND vix_enable_sanitizers)
284+
vix_enable_sanitizers(vix_db_migrator)
285+
endif()
286+
283287
if (MSVC)
284288
target_compile_options(vix_db_migrator PRIVATE ${_WARNINGS_MSVC})
285289
else()
@@ -304,6 +308,10 @@ endif()
304308
add_library(vix_db STATIC ${VIX_DB_SOURCES} ${VIX_DB_PUBLIC_HEADERS})
305309
add_library(vix::db ALIAS vix_db)
306310

311+
if (COMMAND vix_enable_sanitizers)
312+
vix_enable_sanitizers(vix_db)
313+
endif()
314+
307315
# Keep feature macros consistent everywhere (build + consumers)
308316
target_compile_definitions(vix_db PUBLIC
309317
VIX_DB_HAS_MYSQL=$<BOOL:${VIX_DB_HAS_MYSQL}>
@@ -323,11 +331,6 @@ target_include_directories(vix_db PUBLIC
323331
# DB depends on Vix Core (Config.hpp, util, etc.)
324332
target_link_libraries(vix_db PUBLIC vix::core)
325333

326-
# Inherit umbrella sanitizers if present
327-
if (VIX_ENABLE_SANITIZERS AND TARGET vix_sanitizers)
328-
target_link_libraries(vix_db PUBLIC vix_sanitizers)
329-
endif()
330-
331334
if (MSVC)
332335
target_compile_options(vix_db PRIVATE ${_WARNINGS_MSVC})
333336
else()

0 commit comments

Comments
 (0)