mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 20:34:38 +01:00
[cmake] Find libasan and libubsan only if the targets are not already defined by the parent project
This commit is contained in:
parent
64bbc3ce48
commit
919639bd27
@ -63,12 +63,16 @@ option(ASAN OFF "Compile library and executables with LLVM Address Sanitizer")
|
|||||||
option(UBSAN OFF "Compile library and executables with LLVM Undefined Behavior Sanitizer")
|
option(UBSAN OFF "Compile library and executables with LLVM Undefined Behavior Sanitizer")
|
||||||
|
|
||||||
if(ASAN)
|
if(ASAN)
|
||||||
find_package(sanitizer REQUIRED "asan")
|
if(NOT TARGET asan)
|
||||||
|
find_package(sanitizer REQUIRED "asan")
|
||||||
|
endif()
|
||||||
target_link_libraries(app4triqs_c PUBLIC asan)
|
target_link_libraries(app4triqs_c PUBLIC asan)
|
||||||
install(TARGETS asan EXPORT app4triqs-targets)
|
install(TARGETS asan EXPORT app4triqs-targets)
|
||||||
endif()
|
endif()
|
||||||
if(UBSAN)
|
if(UBSAN)
|
||||||
find_package(sanitizer REQUIRED "ubsan")
|
if(NOT TARGET ubsan)
|
||||||
|
find_package(sanitizer REQUIRED "ubsan")
|
||||||
|
endif()
|
||||||
target_link_libraries(app4triqs_c PUBLIC ubsan)
|
target_link_libraries(app4triqs_c PUBLIC ubsan)
|
||||||
install(TARGETS ubsan EXPORT app4triqs-targets)
|
install(TARGETS ubsan EXPORT app4triqs-targets)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user