File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ project(aws-lambda-runtime
6
6
7
7
option (ENABLE_LTO "Enables link-time optimization, requires compiler support." OFF )
8
8
option (ENABLE_TESTS "Enables building the test project, requires AWS C++ SDK." OFF )
9
+ option (ENABLE_SANITIZERS "Enables ASan and UBSan." OFF )
9
10
10
11
add_library (${PROJECT_NAME}
11
12
"src/logging.cpp"
@@ -22,6 +23,11 @@ target_include_directories(${PROJECT_NAME} PUBLIC
22
23
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
23
24
$<INSTALL_INTERFACE:include >)
24
25
26
+ if (ENABLE_SANITIZERS)
27
+ target_compile_options (${PROJECT_NAME} PUBLIC "-fsanitize=address,undefined" )
28
+ target_link_libraries (${PROJECT_NAME} PUBLIC "-fsanitize=address,undefined" )
29
+ endif ()
30
+
25
31
if (ENABLE_LTO)
26
32
include (CheckIPOSupported)
27
33
check_ipo_supported(RESULT has_lto OUTPUT lto_check_output)
Original file line number Diff line number Diff line change 4
4
build :
5
5
commands :
6
6
- echo Build started on `date`
7
- - ./ci/codebuild/build.sh -DTEST_RESOURCE_PREFIX=lambda-cpp-archbtw
7
+ - ./ci/codebuild/build.sh -DTEST_RESOURCE_PREFIX=lambda-cpp-archbtw -DENABLE_SANITIZERS=ON
8
8
- ./ci/codebuild/run-tests.sh aws-lambda-package-lambda-test-fun
9
9
- echo Build completed on `date`
You can’t perform that action at this time.
0 commit comments