@@ -55,6 +55,11 @@ def _ecsact_binary_impl(ctx):
5555 report_filter = ctx .var .get ("ECSACT_CLI_REPORT_FILTER" , "errors_and_warnings" )
5656 args .add ("--report_filter" , report_filter )
5757
58+ if ctx .var ["COMPILATION_MODE" ] == "dbg" :
59+ args .add ("--debug" )
60+ if ctx .attr .debug_symbols_extension :
61+ outputs .append (ctx .actions .declare_file ("{}{}" .format (ctx .attr .name , ctx .attr .debug_symbols_extension )))
62+
5863 compiler_config = {
5964 "compiler_type" : "auto" ,
6065 "compiler_path" : cc_toolchain .compiler_executable ,
@@ -150,6 +155,9 @@ _ecsact_binary = rule(
150155 "interface_library_extension" : attr .string (
151156 mandatory = True ,
152157 ),
158+ "debug_symbols_extension" : attr .string (
159+ mandatory = True ,
160+ ),
153161 "linkopts" : attr .string_list (
154162 mandatory = False ,
155163 ),
@@ -174,5 +182,12 @@ def ecsact_binary(**kwargs):
174182 "@platforms//os:wasi" : "" ,
175183 "@platforms//os:none" : "" , # for non-wasi
176184 }),
185+ debug_symbols_extension = select ({
186+ "@platforms//os:windows" : ".pdb" ,
187+ "@platforms//os:linux" : "" ,
188+ "@platforms//os:macos" : "" ,
189+ "@platforms//os:wasi" : "" ,
190+ "@platforms//os:none" : "" , # for non-wasi
191+ }),
177192 ** kwargs
178193 )
0 commit comments