mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
lestarch: fixing -static-libasan -static-libsan issue with gcc 10
This commit is contained in:
parent
072ab35ea1
commit
1f44453b53
1
.github/actions/spelling/expect.txt
vendored
1
.github/actions/spelling/expect.txt
vendored
@ -854,6 +854,7 @@ libclang
|
||||
libcrc
|
||||
libgtest
|
||||
libiconv
|
||||
libsan
|
||||
LIBLOC
|
||||
lic
|
||||
lifecycle
|
||||
|
||||
@ -48,11 +48,17 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-Wno-zero-length-array>
|
||||
)
|
||||
endif()
|
||||
set(SAN_STATIC_FLAG -static-libasan)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
|
||||
set(SAN_STATIC_FLAG -static-libasan)
|
||||
endif()
|
||||
|
||||
|
||||
find_program(VALGRIND valgrind) # Find valgrind, and use it instead of leak check
|
||||
# For this testing cmake project, enable AddressSanitizer, a runtime memory sanitizer, on all unit tests
|
||||
if (BUILD_TESTING AND NOT VALGRIND)
|
||||
add_compile_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize=leak -fsanitize=undefined -static-libasan)
|
||||
add_link_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize=leak -fsanitize=undefined -static-libasan)
|
||||
add_compile_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize=leak -fsanitize=undefined ${SAN_STATIC_FLAG})
|
||||
add_link_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize=leak -fsanitize=undefined ${SAN_STATIC_FLAG})
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/FPrime-Code.cmake")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user