Skip to content

Commit

Permalink
Fix regression in TI CGT support
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mon authored and soumyaDghosh committed Jun 4, 2024
1 parent 04604b3 commit 4b2b1d0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mesonbuild/compilers/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,13 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker
return linkers.CcrxLinker(linker)
if out.startswith('GNU ar') and 'xc16-ar' in linker_name:
return linkers.Xc16Linker(linker)
if "--> error: bad option 'e'" in err: # TI
if 'Texas Instruments Incorporated' in out:
if 'ar2000' in linker_name:
return linkers.C2000Linker(linker)
elif 'ar6000' in linker_name:
return linkers.C6000Linker(linker)
else:
return linkers.TILinker(linker)
if 'Texas Instruments Incorporated' in out:
if 'ar6000' in linker_name:
return linkers.C6000Linker(linker)
if out.startswith('The CompCert'):
return linkers.CompCertLinker(linker)
if out.strip().startswith('Metrowerks') or out.strip().startswith('Freescale'):
Expand Down Expand Up @@ -437,8 +436,8 @@ def sanitize(p: T.Optional[str]) -> T.Optional[str]:
'TI ARM C/C++ Compiler': (c.TICCompiler, cpp.TICPPCompiler, linkers.TIDynamicLinker),
'MSP430 C/C++': (c.TICCompiler, cpp.TICPPCompiler, linkers.TIDynamicLinker)
}
for indentifier, compiler_classes in ti_compilers.items():
if indentifier in out:
for identifier, compiler_classes in ti_compilers.items():
if identifier in out:
cls = compiler_classes[0] if lang == 'c' else compiler_classes[1]
lnk = compiler_classes[2]
env.coredata.add_lang_args(cls.language, cls, for_machine, env)
Expand Down

0 comments on commit 4b2b1d0

Please sign in to comment.