@@ -4,6 +4,7 @@ project ("cc_mqtt5_cc_tools_qt_plugin")
44# Build options:
55option (OPT_WARN_AS_ERR "Treat warnings as errors" ON )
66option (OPT_USE_CCACHE "Use ccache" OFF )
7+ option (OPT_WITH_DEFAULT_SANITIZERS "Build with sanitizers" OFF )
78option (OPT_INSTALL_DEFAULT_CONFIG "Install default plugin configuration" ON )
89
910# Configuration variables:
@@ -45,6 +46,10 @@ if (OPT_USE_CCACHE)
4546 endif ()
4647endif ()
4748
49+ if (OPT_WITH_DEFAULT_SANITIZERS)
50+ list (APPEND extra_opts DEFAULT_SANITIZERS)
51+ endif ()
52+
4853include (${LibComms_DIR} /CC_Compile.cmake )
4954cc_compile (${extra_opts} )
5055cc_msvc_force_warn_opt (/W4 )
@@ -97,7 +102,7 @@ function (cc_plugin_core)
97102 target_compile_options (${name} PRIVATE
98103 $<$<CXX_COMPILER_ID :MSVC >:/bigobj /wd4127 /wd5054 >
99104 $<$<CXX_COMPILER_ID :GNU >:-ftemplate -depth =2048 -fconstexpr -depth =4096 -Wno -unused -local -typedefs >
100- $<$<CXX_COMPILER_ID :Clang >:-ftemplate -depth =2048 -fconstexpr -depth =4096 -Wno -unused -local -typedefs >
105+ $<$<CXX_COMPILER_ID :Clang >:-ftemplate -depth =2048 -fconstexpr -depth =4096 -fbracket - depth =2048 - Wno -unused -local -typedefs >
101106 )
102107
103108endfunction ()
@@ -142,7 +147,7 @@ function (cc_plugin protocol has_config_widget)
142147 target_compile_options (${name} PRIVATE
143148 $<$<CXX_COMPILER_ID :MSVC >:/bigobj /wd4127 /wd5054 >
144149 $<$<CXX_COMPILER_ID :GNU >:-ftemplate -depth =2048 -fconstexpr -depth =4096>
145- $<$<CXX_COMPILER_ID :Clang >:-ftemplate -depth =2048 -fconstexpr -depth =4096>
150+ $<$<CXX_COMPILER_ID :Clang >:-ftemplate -depth =2048 -fconstexpr -depth =4096 - fbracket - depth =2048 >
146151 )
147152
148153 install (
0 commit comments