Skip to content

Commit

Permalink
chore(build): support sanitized builds
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Nov 17, 2024
1 parent 5e590da commit 0c74c75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ endif()
include(PocoMacros)

option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
set(POCO_SANITIZEFLAGS CACHE STRING "Compiler-dependent sanitizer flags (like -fsanitize=address or /fsanitize=address")

if(MSVC)
if (BUILD_SHARED_LIBS)
Expand Down
5 changes: 5 additions & 0 deletions cmake/DefinePlatformSpecifc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ else(MSVC)
set(STATIC_POSTFIX "" CACHE STRING "Set static library postfix" FORCE)
endif(MSVC)

if (DEFINED POCO_SANITIZEFLAGS AND NOT "${POCO_SANITIZEFLAGS}" STREQUAL "")
message(STATUS "Using sanitize flags: ${POCO_SANITIZEFLAGS}")
add_compile_options(${POCO_SANITIZEFLAGS})
add_link_options(${POCO_SANITIZEFLAGS})
endif()


# Add a d postfix to the debug libraries
Expand Down

0 comments on commit 0c74c75

Please sign in to comment.