Skip to content

Commit 2e58354

Browse files
committed
- [fix]: single file extra args is not effect
1 parent b8efde6 commit 2e58354

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/EIDEProject.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export class VirtualSource implements SourceProvider {
226226

227227
this.traverse((folderInfo) => {
228228
result.push({
229-
name: folderInfo.path.replace(`${VirtualSource.rootName}/`, ''),
229+
name: folderInfo.path,
230230
disabled: this.project.isExcluded(folderInfo.path) || undefined,
231231
files: folderInfo.folder.files.map((vFile) => {
232232
const file = new File(this.project.ToAbsolutePath(vFile.path));
@@ -2611,7 +2611,7 @@ class EIDEProject extends AbstractProject {
26112611
}
26122612

26132613
private getExtraCompilerOptionsBySrcFile(srcPath: string, vPath?: string): string[] | undefined {
2614-
return this.getExtraArgsForSource(srcPath, vPath, this.getSourceExtraArgsCfg());
2614+
return this.getExtraArgsForSource(srcPath, vPath, this.getSourceExtraArgsCfg());
26152615
}
26162616

26172617
//////////////////////////////// source refs ///////////////////////////////////
@@ -2830,12 +2830,16 @@ class EIDEProject extends AbstractProject {
28302830

28312831
// is virtual source
28322832
else {
2833-
fileGroups.push(_group);
2833+
fileGroups.push({
2834+
name: _group.name.replace(`${VirtualSource.rootName}/`, ''), // remove '<virtual_root>/' header for keil
2835+
files: _group.files,
2836+
disabled: _group.disabled
2837+
});
28342838
}
28352839
});
28362840

28372841
if (halFiles.length > 0) {
2838-
const index = fileGroups.findIndex((group) => { return group.name === 'HAL'; });
2842+
const index = fileGroups.findIndex((group) => group.name === 'HAL');
28392843
if (index === -1) {
28402844
fileGroups.push(<FileGroup>{
28412845
name: 'HAL',

src/EIDETypeDefine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface FileItem {
6161
}
6262

6363
export interface FileGroup {
64-
name: string; // dir name if it's system folder, else it's a virtual path
64+
name: string; // dir name if it's system folder, else it's a virtual path (with '<virtual_root>/' header)
6565
files: FileItem[];
6666
disabled?: boolean; // for mdk group info
6767
}

0 commit comments

Comments
 (0)