Skip to content

Commit c340dbc

Browse files
authored
Merge pull request #373 from github0null/dev
v3.19.8 update
2 parents af2f20c + 1127119 commit c340dbc

28 files changed

+220
-104
lines changed

Diff for: CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ All notable version changes will be recorded in this file.
66

77
***
88

9+
### [v3.19.8] update
10+
11+
**Fix**:
12+
- `Chip Package`: Storage layout default value missed.
13+
- `Unify Builder`: Fix ac6 linker options missed on macos. Thanks [@Deadline039](https://github.com/Deadline039).
14+
15+
**Optimize**:
16+
- `Unify Builder`: Use 'dotnet unify_builder.dll' instead of 'unify_builder.exe' on arm64 platform.
17+
- `C/C++ Config Provider`: Use g++ when provide compilerPath for cpptools.
18+
- `Other`: Append msys path to the tail of system PATH, not head.
19+
20+
***
21+
922
### [v3.19.6] update
1023

1124
**Change**:

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Embedded IDE
22

3+
[![](https://img.shields.io/badge/home_page-em--ide.com-blue)](https://em-ide.com/)
4+
[![](https://img.shields.io/badge/chat-discuss.em--ide.com-orange)](https://discuss.em-ide.com/)
5+
[![](https://img.shields.io/visual-studio-marketplace/v/CL.eide)](https://marketplace.visualstudio.com/items?itemName=CL.eide)
6+
[![](https://img.shields.io/visual-studio-marketplace/i/CL.eide)](https://marketplace.visualstudio.com/items?itemName=CL.eide)
7+
[![](https://img.shields.io/visual-studio-marketplace/stars/CL.eide)](https://marketplace.visualstudio.com/items?itemName=CL.eide&ssr=false#review-details)
8+
39
***
410

511
## [中文](./README_ZH-CN.md)

Diff for: README_ZH-CN.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Embedded IDE
22

3+
[![](https://img.shields.io/badge/主页-em--ide.com-blue)](https://em-ide.com/)
4+
[![](https://img.shields.io/badge/论坛-discuss.em--ide.com-orange)](https://discuss.em-ide.com/)
5+
[![](https://img.shields.io/visual-studio-marketplace/v/CL.eide)](https://marketplace.visualstudio.com/items?itemName=CL.eide)
6+
[![](https://img.shields.io/visual-studio-marketplace/i/CL.eide)](https://marketplace.visualstudio.com/items?itemName=CL.eide)
7+
[![](https://img.shields.io/visual-studio-marketplace/stars/CL.eide)](https://marketplace.visualstudio.com/items?itemName=CL.eide&ssr=false#review-details)
8+
39
***
410

511
## 简述 📑

Diff for: lib/node-utility

Diff for: package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
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.19.6",
41+
"version": "3.19.8",
4242
"preview": false,
4343
"engines": {
4444
"vscode": "^1.67.0"

Diff for: res/tools/darwin/unify_builder/arm64/axf2elf.dll

0 Bytes
Binary file not shown.

Diff for: res/tools/darwin/unify_builder/arm64/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/osx-arm64": {
10-
"unify_builder/3.7.4": {
10+
"unify_builder/3.7.5": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.7.4": {
63+
"unify_builder/3.7.5": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""
512 Bytes
Binary file not shown.

Diff for: res/tools/darwin/unify_builder/x86_64/axf2elf.dll

0 Bytes
Binary file not shown.

Diff for: res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/osx-x64": {
10-
"unify_builder/3.7.4": {
10+
"unify_builder/3.7.5": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.7.4": {
63+
"unify_builder/3.7.5": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""
512 Bytes
Binary file not shown.

Diff for: res/tools/linux/unify_builder/axf2elf.dll

0 Bytes
Binary file not shown.

Diff for: res/tools/linux/unify_builder/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/linux-x64": {
10-
"unify_builder/3.7.4": {
10+
"unify_builder/3.7.5": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.7.4": {
63+
"unify_builder/3.7.5": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""

Diff for: res/tools/linux/unify_builder/unify_builder.dll

512 Bytes
Binary file not shown.

Diff for: res/tools/win32/unify_builder/axf2elf.dll

0 Bytes
Binary file not shown.

Diff for: res/tools/win32/unify_builder/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/win-x64": {
10-
"unify_builder/3.7.4": {
10+
"unify_builder/3.7.5": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.7.4": {
63+
"unify_builder/3.7.5": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""

Diff for: res/tools/win32/unify_builder/unify_builder.dll

512 Bytes
Binary file not shown.

Diff for: res/tools/win32/unify_builder/unify_builder.exe

0 Bytes
Binary file not shown.

Diff for: res/tools/win32/unify_builder/unify_builder.zip

-196 KB
Binary file not shown.

Diff for: src/CodeBuilder.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import { ArrayDelRepetition } from "../lib/node-utility/Utility";
4949
import { DependenceManager } from "./DependenceManager";
5050
import { WorkspaceManager } from "./WorkspaceManager";
5151
import { ToolchainName } from "./ToolchainManager";
52-
import { md5, sha256, copyObject } from "./utility";
52+
import { md5, sha256, copyObject, generateDotnetProgramCmd } from "./utility";
5353
import { exeSuffix, osType } from "./Platform";
5454
import { FileWatcher } from "../lib/node-utility/FileWatcher";
5555
import { STVPFlasherOptions } from './HexUploader';
@@ -322,10 +322,8 @@ export abstract class CodeBuilder {
322322
outDir.CreateDir(true);
323323

324324
// generate command line
325-
const commandLine = CmdLineHandler.getCommandLine(
326-
ResManager.instance().getUnifyBuilderExe().noSuffixName,
327-
this.getCommands()
328-
);
325+
const commandLine = generateDotnetProgramCmd(
326+
ResManager.instance().getUnifyBuilderExe(), this.getCommands());
329327

330328
// if only generate params, exit
331329
if (options?.onlyGenParams) return;

Diff for: src/EIDEProject.ts

+20-3
Original file line numberDiff line numberDiff line change
@@ -2510,6 +2510,9 @@ $(OUT_DIR):
25102510
this.registerBuiltinVar('SYS_PathSep', () => platform.osType() != 'win32' ? ':' : ';');
25112511
this.registerBuiltinVar('SYS_PathSeparator', () => platform.osType() != 'win32' ? ':' : ';');
25122512
this.registerBuiltinVar('SYS_EOL', () => os.EOL);
2513+
2514+
// eide vars
2515+
this.registerBuiltinVar('UnifyBuilderDir', () => ResManager.instance().getUnifyBuilderExe().dir);
25132516
}
25142517

25152518
private RegisterEvent(): void {
@@ -2816,6 +2819,8 @@ $(OUT_DIR):
28162819

28172820
public abstract getSourceRefs(file: File): File[];
28182821

2822+
public abstract getCpptoolsConfig(): CppConfigItem;
2823+
28192824
//-----------------------------------------------------------
28202825

28212826
public abstract createBase(option: CreateOptions, createNewPrjFolder?: boolean): BaseProjectInfo;
@@ -3678,6 +3683,10 @@ class EIDEProject extends AbstractProject {
36783683

36793684
private __cpptools_updateTimeout: NodeJS.Timeout | undefined;
36803685

3686+
getCpptoolsConfig(): CppConfigItem {
3687+
return <CppConfigItem>deepCloneObject(this.cppToolsConfig);
3688+
}
3689+
36813690
forceUpdateCpptoolsConfig(): void {
36823691
this.UpdateCppConfig();
36833692
}
@@ -3944,9 +3953,17 @@ class EIDEProject extends AbstractProject {
39443953
// c++ files
39453954
else {
39463955

3947-
let compilerArgs = this.cppToolsConfig.cppCompilerArgs;
3956+
const compilerArgs: string[] = [];
3957+
const compilerPath = this.getToolchain().getGccFamilyCompilerPathForCpptools('c++');
3958+
3959+
// We need to tell gcc compiler: this is a c++ file
3960+
if (compilerPath) {
3961+
compilerArgs.push('-xc++');
3962+
}
3963+
3964+
this.cppToolsConfig.cppCompilerArgs?.forEach(arg => compilerArgs.push(arg));
39483965
if (fileArgs) {
3949-
compilerArgs = (compilerArgs || []).concat(fileArgs);
3966+
fileArgs.forEach(arg => compilerArgs.push(arg));
39503967
}
39513968

39523969
return {
@@ -3957,7 +3974,7 @@ class EIDEProject extends AbstractProject {
39573974
includePath: this.cppToolsConfig.includePath,
39583975
defines: this.cppToolsConfig.defines,
39593976
forcedInclude: this.cppToolsConfig.forcedInclude,
3960-
compilerPath: this.cppToolsConfig.compilerPath,
3977+
compilerPath: compilerPath || "",
39613978
compilerArgs: compilerArgs
39623979
}
39633980
};

Diff for: src/EIDEProjectExplorer.ts

+61-42
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ import {
103103
compareVersion,
104104
getGccSystemSearchList,
105105
openocd_getConfigList,
106-
pyocd_getTargetList
106+
pyocd_getTargetList,
107+
generateDotnetProgramCmd
107108
} from './utility';
108109
import { concatSystemEnvPath, DeleteDir, exeSuffix, kill, osType, DeleteAllChildren } from './Platform';
109110
import { KeilARMOption, KeilC51Option, KeilParser, KeilRteDependence } from './KeilXmlParser';
@@ -2732,7 +2733,7 @@ class ProjectDataProvider implements vscode.TreeDataProvider<ProjTreeItem>, vsco
27322733

27332734
const compilerOpt = <ArmBaseCompileData>nEideTarget.compileConfig;
27342735
compilerOpt.cpuType = guessArmCpuType(eTarget) || 'Cortex-M3';
2735-
compilerOpt.floatingPointHardware = /-M[4-9]\d+/.test(compilerOpt.cpuType) ? 'single' : 'none';
2736+
compilerOpt.floatingPointHardware = ArmCpuUtils.hasFpu(compilerOpt.cpuType) ? 'single' : 'none';
27362737
compilerOpt.useCustomScatterFile = true;
27372738
compilerOpt.scatterFilePath = '';
27382739

@@ -3862,50 +3863,68 @@ export class ProjectExplorer implements CustomConfigurationProvider {
38623863

38633864
private async registerClangdProvider(prj: AbstractProject) {
38643865

3865-
if (this.cppToolsApi) {
3866-
// 如果 cpptools 激活了,则禁用 clangd,防止两个冲突
3867-
return;
3868-
}
3866+
if (this.cppToolsApi)
3867+
return; // 如果 cpptools 激活了,则禁用 clangd,防止两个冲突
38693868

38703869
prj.on('cppConfigChanged', () => {
3871-
// todo
3872-
});
38733870

3874-
// ----------------------
3875-
// setup clangd config
3876-
// ----------------------
3877-
try {
3878-
let cfg: any = {};
3879-
const fclangd = File.fromArray([prj.getProjectRoot().path, '.clangd']);
3880-
if (fclangd.IsFile()) {
3881-
cfg = yaml.parse(fclangd.Read());
3871+
const envs = prj.getProjectVariables();
3872+
if (envs['EIDE_CLANGD_PROVIDER_ENABLE'] == '0') {
3873+
GlobalEvent.log_info(`ignore update .clangd, because EIDE_CLANGD_PROVIDER_ENABLE=0 is set`);
3874+
return;
38823875
}
3883-
if (!cfg['CompileFlags']) cfg['CompileFlags'] = {};
3884-
if (!cfg['CompileFlags']['Add']) cfg['CompileFlags']['Add'] = []
3885-
//
3886-
cfg['CompileFlags']['CompilationDatabase'] = './' + File.ToUnixPath(prj.getOutputDir());
3887-
const toolchain = prj.getToolchain();
3888-
const gccLikePath = toolchain.getGccFamilyCompilerPathForCpptools();
3889-
if (gccLikePath) { // 仅兼容gcc的编译器
3890-
cfg['CompileFlags']['Compiler'] = gccLikePath;
3891-
let args: string[] = cfg['CompileFlags']['Add'];
3892-
if (/GCC/.test(toolchain.name)) {
3893-
let li = getGccSystemSearchList(File.ToLocalPath(gccLikePath));
3894-
if (li) {
3895-
li.forEach(p => {
3896-
args.push(`-I${File.normalize(p)}`);
3897-
});
3898-
}
3899-
} else {
3900-
args.push(`-I${toolchain.getToolchainDir().path}/include`);
3901-
args.push(`-I${toolchain.getToolchainDir().path}/include/libcxx`);
3876+
3877+
// ----------------------
3878+
// setup clangd config
3879+
// ----------------------
3880+
try {
3881+
let cfg: any = {};
3882+
const fclangd = File.fromArray([prj.getProjectRoot().path, '.clangd']);
3883+
if (fclangd.IsFile()) {
3884+
cfg = yaml.parse(fclangd.Read());
39023885
}
3903-
cfg['CompileFlags']['Add'] = ArrayDelRepetition(args);
3886+
if (!cfg['CompileFlags']) cfg['CompileFlags'] = {};
3887+
if (!cfg['CompileFlags']['Add']) cfg['CompileFlags']['Add'] = []
3888+
//
3889+
cfg['CompileFlags']['CompilationDatabase'] = './' + File.ToUnixPath(prj.getOutputDir());
3890+
const toolchain = prj.getToolchain();
3891+
const gccLikePath = toolchain.getGccFamilyCompilerPathForCpptools('c++');
3892+
if (gccLikePath) { // 仅兼容gcc的编译器
3893+
cfg['CompileFlags']['Compiler'] = gccLikePath;
3894+
let clangdCompileFlags = <string[]>(cfg['CompileFlags']['Add']);
3895+
let compilerArgs = prj.getCpptoolsConfig().cppCompilerArgs;
3896+
if (/GCC/.test(toolchain.name)) {
3897+
const tRoot = toolchain.getToolchainDir().path;
3898+
clangdCompileFlags = clangdCompileFlags.filter(p => !File.isSubPathOf(tRoot, p.substr(2)));
3899+
let li = getGccSystemSearchList(File.ToLocalPath(gccLikePath), ['-xc++'].concat(compilerArgs || []));
3900+
if (li) {
3901+
li.forEach(p => {
3902+
clangdCompileFlags.push(`-I${File.normalize(p)}`);
3903+
});
3904+
}
3905+
} else {
3906+
clangdCompileFlags.push(`-I${toolchain.getToolchainDir().path}/include`);
3907+
clangdCompileFlags.push(`-I${toolchain.getToolchainDir().path}/include/libcxx`);
3908+
}
3909+
// // add flags
3910+
// if (compilerArgs)
3911+
// compilerArgs.forEach(arg => clangdCompileFlags.push(arg));
3912+
// // add user includes
3913+
// prj.getCpptoolsConfig().includePath
3914+
// .forEach(path => clangdCompileFlags.push(`-I${path}`));
3915+
// // add user defines
3916+
// prj.getCpptoolsConfig().defines
3917+
// .forEach(d => clangdCompileFlags.push(`-D${d}`));
3918+
// del repeat
3919+
cfg['CompileFlags']['Add'] = ArrayDelRepetition(clangdCompileFlags);
3920+
}
3921+
fclangd.Write(yaml.stringify(cfg));
3922+
} catch (error) {
3923+
GlobalEvent.log_error(error);
39043924
}
3905-
fclangd.Write(yaml.stringify(cfg));
3906-
} catch (error) {
3907-
GlobalEvent.log_error(error);
3908-
}
3925+
});
3926+
3927+
prj.forceUpdateCpptoolsConfig();
39093928
}
39103929

39113930
// -----------------------------------------
@@ -4445,8 +4464,8 @@ export class ProjectExplorer implements CustomConfigurationProvider {
44454464
paramsFile.Write(JSON.stringify(cmdList));
44464465

44474466
/* launch */
4448-
const exeName = ResManager.GetInstance().getUnifyBuilderExe().noSuffixName;
4449-
const commandLine = CmdLineHandler.getCommandLine(exeName, ['-r', paramsFile.path]);
4467+
const commandLine = generateDotnetProgramCmd(
4468+
ResManager.instance().getUnifyBuilderExe(), ['-r', paramsFile.path]);
44504469
runShellCommand('build workspace', commandLine);
44514470
}
44524471

0 commit comments

Comments
 (0)