Skip to content

Commit

Permalink
RDKB-54346: Add AddressSanitizer as a CMake build option for the rbus…
Browse files Browse the repository at this point in the history
… code (#197)

Reason for change: Add AddressSanitizer as a CMake build option for the rbus code
Test Procedure: Test and verified.
Risks: Medium
Priority: P1

Signed-off-by: Deepthi C Shetty <[email protected]>
  • Loading branch information
dshett549 authored Mar 15, 2024
1 parent 45ce06b commit b72b95b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ set(CMAKE_C_FLAGS_RELEASE "-fPIC -Wall -Werror -Wextra ${CMAKE_C_FLAGS_RELEASE}
set(CMAKE_CXX_FLAGS_DEBUG "-fPIC -Wall -Werror -Wextra -Wno-type-limits -fno-inline ${CMAKE_C_FLAGS_DEBUG} -DRBUS_ALWAYS_ON ")
set(CMAKE_CXX_FLAGS_RELEASE "-fPIC -Wall -Werror -Wextra ${CMAKE_C_FLAGS_RELEASE} -DRBUS_ALWAYS_ON ")

if(ENABLE_ADDRESS_SANITIZER)
set(CMAKE_C_FLAGS "-fsanitize=address ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fsanitize=address ${CMAKE_CXX_FLAGS}")
endif(ENABLE_ADDRESS_SANITIZER)

include(GNUInstallDirs)

IF (NOT DEFINED CMAKE_INSTALL_BINDIR)
Expand Down

0 comments on commit b72b95b

Please sign in to comment.