Skip to content

Commit 3f9d9ce

Browse files
authored
Merge pull request #334 from github0null/dev
v3.16.1 update
2 parents cfae8b7 + 9d24c00 commit 3f9d9ce

16 files changed

+365
-130
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ All notable version changes will be recorded in this file.
66

77
***
88

9+
### [v3.16.1] update
10+
11+
**Fix**:
12+
- `Open Project`: fix cannot open project if a error target in usr.ctx.json.
13+
- `Project Floatpoint Selection`: fix function hasFpu() not match 'm33.dsp'.
14+
- `Diagnostic Bugs`: fix diagnostic information generator bugs.
15+
- `Others`: fix other miscellaneous bugs.
16+
17+
**Optimize**:
18+
- `.NET Runtime`: compatible with version > 6.0 of the .NET runtime.
19+
- `Static Check`: optimize cppcheck params generator.
20+
21+
***
22+
923
### [v3.16.0] update
1024

1125
**Change**:

package.json

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"homepage": "https://em-ide.com",
3939
"license": "MIT",
4040
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/MIPS/RISC-V",
41-
"version": "3.16.0",
41+
"version": "3.16.1",
4242
"preview": false,
4343
"engines": {
4444
"vscode": "^1.67.0"
@@ -673,12 +673,12 @@
673673
"title": "Show All Symbols"
674674
},
675675
{
676-
"command": "_cl.eide.project.cppcheck.check_all",
677-
"title": "%eide.project.run.cppcheck%"
676+
"command": "_cl.eide.project.static-check.cppcheck",
677+
"title": "%eide.prj.menus.sub.static-check.cppcheck%"
678678
},
679679
{
680-
"command": "_cl.eide.project.cppcheck.clear_all",
681-
"title": "%eide.project.clear.cppcheck%"
680+
"command": "_cl.eide.project.static-check.clear",
681+
"title": "%eide.prj.menus.sub.static-check.clear%"
682682
},
683683
{
684684
"command": "_cl.eide.project.source.modify.exclude_list",
@@ -1074,11 +1074,21 @@
10741074
"when": "cl.eide.projectActived && !isInDiffEditor"
10751075
},
10761076
{
1077-
"command": "_cl.eide.project.cppcheck.check_all",
1077+
"command": "_cl.eide.project.static-check.cppcheck",
10781078
"key": "ctrl+alt+c",
10791079
"when": "cl.eide.projectActived"
10801080
}
10811081
],
1082+
"submenus": [
1083+
{
1084+
"id": "_cl.eide.menu/ui/project/static-check",
1085+
"label": "%eide.prj.menus.main.static-check%"
1086+
},
1087+
{
1088+
"id": "_cl.eide.menu/ui/project/export",
1089+
"label": "%eide.prj.menus.main.export%"
1090+
}
1091+
],
10821092
"menus": {
10831093
"view/title": [
10841094
{
@@ -1264,25 +1274,13 @@
12641274
"group": "6_group"
12651275
},
12661276
{
1267-
"command": "_cl.eide.project.exportAsTemplate",
1268-
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1277+
"submenu": "_cl.eide.menu/ui/project/export",
12691278
"group": "9_group"
12701279
},
12711280
{
1272-
"command": "_cl.eide.project.exportXml",
1273-
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1274-
"group": "9_group"
1275-
},
1276-
{
1277-
"command": "_cl.eide.project.cppcheck.check_all",
1278-
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1281+
"submenu": "_cl.eide.menu/ui/project/static-check",
12791282
"group": "z_group0@0"
12801283
},
1281-
{
1282-
"command": "_cl.eide.project.cppcheck.clear_all",
1283-
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1284-
"group": "z_group0@1"
1285-
},
12861284

12871285

12881286
{
@@ -1540,6 +1538,30 @@
15401538
"group": "inline",
15411539
"when": "viewItem == ACTIVED_GROUP && view == cl.eide.view.projects"
15421540
}
1541+
],
1542+
"_cl.eide.menu/ui/project/export": [
1543+
{
1544+
"command": "_cl.eide.project.exportAsTemplate",
1545+
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1546+
"group": "9_group"
1547+
},
1548+
{
1549+
"command": "_cl.eide.project.exportXml",
1550+
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1551+
"group": "9_group"
1552+
}
1553+
],
1554+
"_cl.eide.menu/ui/project/static-check": [
1555+
{
1556+
"command": "_cl.eide.project.static-check.cppcheck",
1557+
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1558+
"group": "z_group0@0"
1559+
},
1560+
{
1561+
"command": "_cl.eide.project.static-check.clear",
1562+
"when": "viewItem == SOLUTION && view == cl.eide.view.projects",
1563+
"group": "z_group1@1"
1564+
}
15431565
]
15441566
},
15451567
"snippets": [

package.nls.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"eide.project.save.all": "Save All Projects",
2121
"eide.project.active": "Active Project",
2222
"eide.project.close": "Close Project",
23-
"eide.project.export.template": "Export Eide Project Template",
24-
"eide.project.export.keil": "Export Keil Project",
23+
"eide.project.export.template": "Eide Project Template",
24+
"eide.project.export.keil": "Keil Project",
2525
"eide.project.show.commands": "Show Compiler CommandLine",
2626
"eide.project.switch.target": "Switch Target",
2727
"eide.project.build": "Build",
@@ -34,12 +34,11 @@
3434
"eide.project.import.ext.project.src.struct": "Import SourceFile Tree From Other Project",
3535
"eide.project.generate_builder_params": "Generate builder.params",
3636

37-
"eide.prj.menus.main.cppcheck": "Static Check",
38-
"eide.prj.menus.sub.cppcheck.run": "Check Project by Cppcheck",
39-
"eide.prj.menus.sub.cppcheck.clear": "Clear Cppcheck Diagnostic Informations",
37+
"eide.prj.menus.main.static-check": "Static Check",
38+
"eide.prj.menus.sub.static-check.cppcheck": "Run Cppcheck",
39+
"eide.prj.menus.sub.static-check.clear": "Clear Diagnostic Informations",
40+
4041
"eide.prj.menus.main.export": "Export As ...",
41-
"eide.prj.menus.main.export.keil": "Keil Project",
42-
"eide.prj.menus.main.export.eide": "Eide Project Template",
4342

4443
"eide.workspace.build": "Build All",
4544
"eide.workspace.rebuild": "Rebuild All",
@@ -73,9 +72,6 @@
7372

7473
"eide.source.show_cmsis_config_wizard": "CMSIS Configuration Wizard",
7574
"eide.source.show.disassembly": "Show Disassembly",
76-
"eide.source.run.cppcheck": "Cppcheck This File",
77-
"eide.project.run.cppcheck": "Cppcheck Project",
78-
"eide.project.clear.cppcheck": "Clear Cppcheck Diagnostic Informations",
7975

8076
"eide.package.install": "Install CMSIS Chip Package",
8177
"eide.package.install.cmsis": "Install CMSIS Header Files",

package.nls.zh-CN.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"eide.project.save.all": "保存所有项目",
2121
"eide.project.active": "设为活动",
2222
"eide.project.close": "关闭项目",
23-
"eide.project.export.template": "导出 EIDE 模板",
24-
"eide.project.export.keil": "导出 Keil 项目",
23+
"eide.project.export.template": "EIDE 模板",
24+
"eide.project.export.keil": "Keil 项目",
2525
"eide.project.show.commands": "查看生成的编译器命令行",
2626
"eide.project.switch.target": "切换目标",
2727
"eide.project.build": "构建",
@@ -34,6 +34,12 @@
3434
"eide.project.import.ext.project.src.struct": "从其他 IDE 的项目中导入源文件树",
3535
"eide.project.generate_builder_params": "生成 builder.params",
3636

37+
"eide.prj.menus.main.static-check": "静态检查",
38+
"eide.prj.menus.sub.static-check.cppcheck": "执行 Cppcheck",
39+
"eide.prj.menus.sub.static-check.clear": "清除诊断结果",
40+
41+
"eide.prj.menus.main.export": "导出为 ...",
42+
3743
"eide.workspace.build": "构建所有项目",
3844
"eide.workspace.rebuild": "重新构建所有项目",
3945
"eide.workspace.open.config": "打开工作区配置",
@@ -66,9 +72,6 @@
6672

6773
"eide.source.show_cmsis_config_wizard": "CMSIS Configuration Wizard",
6874
"eide.source.show.disassembly": "查看反汇编",
69-
"eide.source.run.cppcheck": "使用 Cppcheck 进行检查",
70-
"eide.project.run.cppcheck": "使用 Cppcheck 检查项目",
71-
"eide.project.clear.cppcheck": "清除 Cppcheck 诊断信息",
7275

7376
"eide.package.install": "安装 CMSIS 芯片支持包",
7477
"eide.package.install.cmsis": "安装 CMSIS 头文件",

res/data/template.libs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
#
1111
##########################################################################################
1212

13+
# -----------
14+
# Config
15+
# -----------
16+
# $AR_PATH: '/Your/AR/Executable/Path'
17+
# $AR_CMD : '-rcv ${out} ${in}'
18+
1319
## ----------------------------
1420
## examples
1521
## This examples will generate 2 libs after build done,

src/ArmCpuUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ const armvx_sp_archs: string[] = armvx_dp_archs;
9191
export function hasFpu(cpu: string, hasDp?: boolean) {
9292
cpu = cpu.toLowerCase();
9393
if (hasDp) { // check dp
94-
return cortex_dp_mcus.some(n => cpu.endsWith(n))
95-
|| armvx_dp_archs.some(a => cpu.startsWith(a));
94+
return cortex_dp_mcus.some(a => cpu.includes(a))
95+
|| armvx_dp_archs.some(a => cpu.includes(a));
9696
} else { // check sp
97-
return cortex_sp_mcus.some(n => cpu.endsWith(n))
98-
|| armvx_sp_archs.some(a => cpu.startsWith(a));
97+
return cortex_sp_mcus.some(a => cpu.includes(a))
98+
|| armvx_sp_archs.some(a => cpu.includes(a));
9999
}
100100
}

src/CodeBuilder.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,20 +481,22 @@ export abstract class CodeBuilder {
481481
this.preHandleOptions(builderOptions.options);
482482

483483
// gen libs.makefile
484-
const mkfile = File.fromArray([this.project.ToAbsolutePath(outDir), 'libs.makefile']);
485-
const mk_txt = this.project.genLibsMakefileContent(mkfile.name);
486-
if (mk_txt) {
484+
const mkfile_dir = new File(this.project.ToAbsolutePath(outDir + '/.lib'));
485+
const mkfile_path = `${mkfile_dir.name}/Makefile`;
486+
const mkfile_cont = this.project.genLibsMakefileContent(mkfile_path);
487+
if (mkfile_cont) {
487488
try {
488-
mkfile.Write(mk_txt);
489+
if (!mkfile_dir.IsDir()) mkfile_dir.CreateDir(true);
490+
fs.writeFileSync(`${this.project.ToAbsolutePath(outDir)}/${mkfile_path}`, mkfile_cont);
489491
let command: any = {
490-
name: 'make libs',
491-
command: `make --directory=./${outDir} --makefile=./${mkfile.name} all`
492+
name: 'make libraries',
493+
command: `make --directory=./${outDir} --makefile=./${mkfile_path} all`
492494
};
493495
if (builderOptions.options.afterBuildTasks == undefined)
494496
builderOptions.options.afterBuildTasks = [];
495497
builderOptions.options.afterBuildTasks = [command].concat(builderOptions.options.afterBuildTasks);
496498
} catch (error) {
497-
GlobalEvent.emit('msg', newMessage('Warning', `Generating '${mkfile.name}' failed !`));
499+
GlobalEvent.emit('msg', newMessage('Warning', `Generating '${mkfile_path}' failed !`));
498500
GlobalEvent.emit('globalLog', ExceptionToMessage(error, 'Error'));
499501
}
500502
}

src/EIDEProject.ts

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
ConfigMap, FileGroup,
4646
ProjectConfiguration, ProjectConfigData, WorkspaceConfiguration,
4747
CreateOptions,
48-
ProjectConfigEvent, ProjectFileGroup, FileItem, EIDE_CONF_VERSION, ProjectTargetInfo, VirtualFolder, VirtualFile, CppConfigItem, ProjectBaseApi, ProjectType
48+
ProjectConfigEvent, ProjectFileGroup, FileItem, EIDE_CONF_VERSION, ProjectTargetInfo, VirtualFolder, VirtualFile, CppConfigItem, ProjectBaseApi, ProjectType, BuilderConfigData
4949
} from './EIDETypeDefine';
5050
import { ToolchainName, IToolchian, ToolchainManager } from './ToolchainManager';
5151
import { GlobalEvent } from './GlobalEvents';
@@ -57,7 +57,7 @@ import { WebPanelManager } from './WebPanelManager';
5757
import { DependenceManager } from './DependenceManager';
5858
import * as platform from './Platform';
5959
import { IDebugConfigGenerator } from './DebugConfigGenerator';
60-
import { md5, copyObject, compareVersion } from './utility';
60+
import { md5, copyObject, compareVersion, isGccFamilyToolchain } from './utility';
6161
import { ResInstaller } from './ResInstaller';
6262
import {
6363
view_str$prompt$not_found_compiler, view_str$operation$name_can_not_be_blank,
@@ -1827,7 +1827,10 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
18271827
return optFile;
18281828
}
18291829

1830-
genLibsMakefileContent(makefileName: string): string | undefined {
1830+
/**
1831+
* @param makefile_repath a path relative from build output dir, like: '.lib/Makefile'
1832+
*/
1833+
genLibsMakefileContent(makefile_repath: string): string | undefined {
18311834

18321835
const fcfg = this.getLibsGeneratorCfgFile(true);
18331836
if (!fcfg.IsFile())
@@ -1906,6 +1909,9 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
19061909

19071910
for (const name in cfg) {
19081911

1912+
if (name.startsWith('$'))
1913+
continue; // skip internal vars
1914+
19091915
let exprs: string[] = cfg[name];
19101916
if (!Array.isArray(exprs)) continue;
19111917

@@ -1931,6 +1937,11 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
19311937
}
19321938
}
19331939

1940+
if (cfg['$AR_PATH'])
1941+
AR_PATH = File.ToUnixPath(this.toAbsolutePath(cfg['$AR_PATH']));
1942+
if (cfg['$AR_CMD'])
1943+
AR_PARAMS = cfg['$AR_CMD'];
1944+
19341945
// --------------------------
19351946
// - gen makefile
19361947
// --------------------------
@@ -1945,7 +1956,7 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr
19451956
.replace('${out}', outname);
19461957
let rule_tmp = `# ${libname}
19471958
lib${libname}_OBJS += ${objs.join(AR_OBJ_SEP)}
1948-
lib${libname}: $(lib${libname}_OBJS) ${makefileName}
1959+
lib${libname}: $(lib${libname}_OBJS) ${makefile_repath}
19491960
\t@echo -e $(COLOR_BLUE)-------------------------$(COLOR_END)
19501961
\t@echo -e $(COLOR_BLUE)AR "${outname}"$(COLOR_END)
19511962
\t@echo -e $(COLOR_BLUE)-------------------------$(COLOR_END)
@@ -1990,7 +2001,7 @@ $(OUT_DIR):
19902001

19912002
mk_tmp = mk_tmp
19922003
.replace('<LIB_TARGETS>', lib_rules.join('\n'))
1993-
.replace('<LIB_OUT_DIR>', '.lib');
2004+
.replace('<LIB_OUT_DIR>', NodePath.dirname(makefile_repath));
19942005

19952006
return mk_tmp;
19962007
}
@@ -3557,6 +3568,18 @@ class EIDEProject extends AbstractProject {
35573568
}
35583569
}
35593570

3571+
private _getCompilerIntrDefsForCpptools<T extends BuilderConfigData>(
3572+
toolchain: IToolchian, builderCfg: T, builderOpts: ICompileOptions): string[] {
3573+
3574+
if (['AC5', 'AC6'].includes(toolchain.name) || isGccFamilyToolchain(toolchain.name)) {
3575+
// we have provide a xxx-intr.h for cpptools,
3576+
// so return empty list.
3577+
return [];
3578+
} else {
3579+
return toolchain.getInternalDefines(builderCfg, builderOpts);
3580+
}
3581+
}
3582+
35603583
private doUpdateCpptoolsConfig() {
35613584

35623585
const builderOpts = this.getBuilderOptions();
@@ -3566,7 +3589,7 @@ class EIDEProject extends AbstractProject {
35663589
// get project includes and defines
35673590
const depMerge = prjConfig.GetAllMergeDep();
35683591
const defMacros: string[] = ['__VSCODE_CPPTOOL']; // it's for internal force include header
3569-
const intrDefs = toolchain.getInternalDefines(<any>prjConfig.config.compileConfig, builderOpts);
3592+
const intrDefs = this._getCompilerIntrDefsForCpptools(toolchain, <any>prjConfig.config.compileConfig, builderOpts);
35703593
const defLi = defMacros.concat(depMerge.defineList, intrDefs);
35713594
depMerge.incList = depMerge.incList.concat(this.getSourceIncludeList()).map(p => this.ToAbsolutePath(p));
35723595

0 commit comments

Comments
 (0)