From a641e4899fbde3cfe8e0611542be2742818adc12 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Mon, 22 Jun 2020 18:25:30 -0500 Subject: Add "linker=" option to target_compile to support testing --- lib/target.exp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/target.exp b/lib/target.exp index 627f07f..30f6eb3 100644 --- a/lib/target.exp +++ b/lib/target.exp @@ -312,15 +312,15 @@ proc default_target_compile {source destfile type options} { } set early_flags "" - # linker_opts_order is one of "sources-then-flags", "flags-then-sources". - # The order matters for things like -Wl,--as-needed. The default is to - # preserve existing behavior. - set linker_opts_order "sources-then-flags" set add_flags "" set libs "" set compiler_type "c" set compiler "" set linker "" + # linker_opts_order is one of "sources-then-flags", "flags-then-sources". + # The order matters for things like -Wl,--as-needed. The default is to + # preserve existing behavior. + set linker_opts_order "sources-then-flags" set ldflags "" set dest [target_info name] @@ -445,6 +445,10 @@ proc default_target_compile {source destfile type options} { regsub "^compiler=" $i "" tmp set compiler $tmp } + if {[regexp "^linker=" $i]} { + regsub "^linker=" $i "" tmp + set linker $tmp + } if {[regexp "^early_flags=" $i]} { regsub "^early_flags=" $i "" tmp append early_flags " $tmp" -- cgit v1.1