Skip to content

Commit a93d4f9

Browse files
committed
import 'CClasses, UserClasses' for keilc51
1 parent 6d51e0c commit a93d4f9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/KeilXmlParser.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ class C51Parser extends KeilParser<KeilC51Option> {
302302
cOptions['asm-compiler'] = Object.create(null);
303303
cOptions['linker'] = Object.create(null);
304304

305+
cOptions['linker']['misc-controls'] = "";
306+
305307
try {
306308
if (target51.Target51Misc) {
307309
switch (target51.Target51Misc.MemoryModel) {
@@ -336,6 +338,17 @@ class C51Parser extends KeilParser<KeilC51Option> {
336338
cOptions['c/cpp-compiler']['optimization-type'] = target51.C51.SizeSpeed === '0' ? 'SIZE' : 'SPEED';
337339
cOptions['c/cpp-compiler']['optimization-level'] = 'level-' + (target51.C51.Optimize || '8');
338340
}
341+
342+
// import Lx51.CClasses / UserClasses
343+
if (target51.Lx51) {
344+
if (target51.Lx51.CClasses) {
345+
cOptions['linker']['misc-controls'] += `CLASSES (${target51.Lx51.CClasses}) `;
346+
}
347+
if (target51.Lx51.UserClasses) {
348+
cOptions['linker']['misc-controls'] += `CLASSES (${target51.Lx51.UserClasses}) `;
349+
}
350+
}
351+
339352
} catch (error) {
340353
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Warning'));
341354
GlobalEvent.emit('msg', {

0 commit comments

Comments
 (0)