Skip to content

Commit 456d879

Browse files
committed
Fix regression in TI CGT support
When C6000 support was added in mesonbuild#12246, TI compilers were given the correct version argument. This broke the previous check which relied on an error being thrown by the compiler.
1 parent fd626e3 commit 456d879

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mesonbuild/compilers/detect.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,13 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker
228228
return linkers.CcrxLinker(linker)
229229
if out.startswith('GNU ar') and 'xc16-ar' in linker_name:
230230
return linkers.Xc16Linker(linker)
231-
if "--> error: bad option 'e'" in err: # TI
231+
if 'Texas Instruments Incorporated' in out:
232232
if 'ar2000' in linker_name:
233233
return linkers.C2000Linker(linker)
234+
elif 'ar6000' in linker_name:
235+
return linkers.C6000Linker(linker)
234236
else:
235237
return linkers.TILinker(linker)
236-
if 'Texas Instruments Incorporated' in out:
237-
if 'ar6000' in linker_name:
238-
return linkers.C6000Linker(linker)
239238
if out.startswith('The CompCert'):
240239
return linkers.CompCertLinker(linker)
241240
if out.strip().startswith('Metrowerks') or out.strip().startswith('Freescale'):
@@ -441,8 +440,8 @@ def sanitize(p: str) -> str:
441440
'TI ARM C/C++ Compiler': (c.TICCompiler, cpp.TICPPCompiler, linkers.TIDynamicLinker),
442441
'MSP430 C/C++': (c.TICCompiler, cpp.TICPPCompiler, linkers.TIDynamicLinker)
443442
}
444-
for indentifier, compiler_classes in ti_compilers.items():
445-
if indentifier in out:
443+
for identifier, compiler_classes in ti_compilers.items():
444+
if identifier in out:
446445
cls = compiler_classes[0] if lang == 'c' else compiler_classes[1]
447446
lnk = compiler_classes[2]
448447
env.coredata.add_lang_args(cls.language, cls, for_machine, env)

0 commit comments

Comments
 (0)