From 285a6961fad29e7a086fb4b4f8953fb6333273e4 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 9 Dec 2024 07:30:27 +0100 Subject: [PATCH] [client,common] deactivate -fsanitize with helper when compiling manpage generation helper deactivate -fsanitize options to avoid link/runtime issues. --- client/common/man/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/common/man/CMakeLists.txt b/client/common/man/CMakeLists.txt index b508878a4..b01899cf7 100644 --- a/client/common/man/CMakeLists.txt +++ b/client/common/man/CMakeLists.txt @@ -5,10 +5,14 @@ else() add_executable(generate_argument_manpage generate_argument_manpage.c ../cmdline.h) - # Ensure we build with host compiler and no compile/link flags used by other modules. - set_target_properties( - generate_argument_manpage PROPERTIES COMPILE_OPTIONS "" LINK_OPTIONS "" STATIC_LIBRARY_OPTIONS "" - ) + include(CompilerDetect) + if(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCC) + target_compile_options(generate_argument_manpage PRIVATE -fno-sanitize=all) + target_compile_options(generate_argument_manpage PRIVATE -fno-sanitize=all) + + target_link_options(generate_argument_manpage PRIVATE -fno-sanitize=all) + target_link_options(generate_argument_manpage PRIVATE -fno-sanitize=all) + endif() export(TARGETS generate_argument_manpage FILE "${CMAKE_BINARY_DIR}/GenerateArgumentManpageConfig.cmake") endif()