Skip to content

Commit

Permalink
Fix ASAN build and enable it for examples (#828)
Browse files Browse the repository at this point in the history
* Fix ASAN build

* Enable ASAN for examples
  • Loading branch information
sashacmc authored Dec 17, 2024
1 parent 9396627 commit 2f2efb0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,15 @@ if(UNIX)
install(FILES "${CMAKE_SOURCE_DIR}/zenohpico.pc" CONFIGURATIONS Release RelWithDebInfo DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT Dev)
endif()

if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if(ASAN AND !MSVC)
if(ASAN AND NOT MSVC)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()

if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if(UNIX OR MSVC)
if(BUILD_TOOLS)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tools)
Expand Down

0 comments on commit 2f2efb0

Please sign in to comment.