File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 3030 - name : Build & run tests
3131 run : |
3232 sudo apt install -y ninja-build
33- CMAKE_GENERATOR=Ninja make test
33+ CMAKE_GENERATOR=Ninja ASAN=ON make test
3434
3535 check_format :
3636 name : Check codebase format with clang-format
@@ -290,6 +290,6 @@ jobs:
290290 - name : Build & test pico
291291 run : |
292292 sudo apt install -y ninja-build
293- CMAKE_GENERATOR=Ninja make
293+ CMAKE_GENERATOR=Ninja ASAN=ON make
294294 python3 ./build/tests/no_router.py
295295 timeout-minutes : 5
Original file line number Diff line number Diff line change 9797 add_compile_options (-Wpedantic)
9898 endif ()
9999 # add_compile_options(-Wconversion)
100- # add_link_options(-fsanitize=address)
101100 elseif (MSVC )
102101 add_compile_options (/W4 /WX /Od /wd4127)
103102 elseif (CMAKE_SYSTEM_NAME MATCHES "Generic" )
@@ -379,12 +378,14 @@ option(BUILD_EXAMPLES "Use this to also build the examples." ON)
379378option (BUILD_TOOLS "Use this to also build the tools." OFF )
380379option (BUILD_TESTING "Use this to also build tests." ON )
381380option (BUILD_INTEGRATION "Use this to also build integration tests." OFF )
381+ option (ASAN "Enable AddressSanitizer." OFF )
382382
383383message (STATUS "Produce Debian and RPM packages: ${PACKAGING} " )
384384message (STATUS "Build examples: ${BUILD_EXAMPLES} " )
385385message (STATUS "Build tools: ${BUILD_TOOLS} " )
386386message (STATUS "Build tests: ${BUILD_TESTING} " )
387387message (STATUS "Build integration: ${BUILD_INTEGRATION} " )
388+ message (STATUS "AddressSanitizer: ${ASAN} " )
388389
389390set (PICO_LIBS "" )
390391if (PICO_STATIC)
@@ -453,6 +454,11 @@ if(BUILD_EXAMPLES)
453454 add_subdirectory (examples)
454455endif ()
455456
457+ if (ASAN)
458+ add_compile_options (-fsanitize=address)
459+ add_link_options (-fsanitize=address)
460+ endif ()
461+
456462if (UNIX OR MSVC )
457463 if (BUILD_TOOLS)
458464 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /tools)
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ BUILD_TOOLS?=OFF
4141# Accepted values: ON, OFF
4242FORCE_C99? =OFF
4343
44+ # Enable AddressSanitizer.
45+ # Accepted values: ON, OFF
46+ ASAN? =OFF
47+
4448# Debug level. This sets the ZENOH_DEBUG variable.
4549# Accepted values:
4650# 0: NONE
@@ -82,7 +86,7 @@ CMAKE_OPT=-DZENOH_DEBUG=$(ZENOH_DEBUG) -DBUILD_EXAMPLES=$(BUILD_EXAMPLES) -DCMAK
8286 -DZ_FEATURE_MULTI_THREAD=$(Z_FEATURE_MULTI_THREAD ) -DZ_FEATURE_INTEREST=$(Z_FEATURE_INTEREST ) -DZ_FEATURE_UNSTABLE_API=$(Z_FEATURE_UNSTABLE_API ) \
8387 -DZ_FEATURE_PUBLICATION=$(Z_FEATURE_PUBLICATION ) -DZ_FEATURE_SUBSCRIPTION=$(Z_FEATURE_SUBSCRIPTION ) -DZ_FEATURE_QUERY=$(Z_FEATURE_QUERY ) -DZ_FEATURE_QUERYABLE=$(Z_FEATURE_QUERYABLE ) \
8488 -DZ_FEATURE_RAWETH_TRANSPORT=$(Z_FEATURE_RAWETH_TRANSPORT ) -DFRAG_MAX_SIZE=$(FRAG_MAX_SIZE ) -DBATCH_UNICAST_SIZE=$(BATCH_UNICAST_SIZE ) -DBATCH_MULTICAST_SIZE=$(BATCH_MULTICAST_SIZE ) \
85- -DBUILD_INTEGRATION=$(BUILD_INTEGRATION ) -DBUILD_TOOLS=$(BUILD_TOOLS ) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS ) -H.
89+ -DASAN= $( ASAN ) - DBUILD_INTEGRATION=$(BUILD_INTEGRATION ) -DBUILD_TOOLS=$(BUILD_TOOLS ) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS ) -H.
8690
8791ifeq ($(FORCE_C99 ) , ON)
8892 CMAKE_OPT += -DCMAKE_C_STANDARD=99
You can’t perform that action at this time.
0 commit comments