cpp.js 2.0.0-beta.4 → 2.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/actions/getData.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
3
2
|
import state from '../state/index.js';
|
|
4
|
-
import { getFilteredTargetSpec } from './target.js';
|
|
3
|
+
import { getFilteredTargetSpec, getBuildTargets } from './target.js';
|
|
5
4
|
|
|
6
5
|
function getRecursiveData(obj, config, dependency, field, target) {
|
|
7
6
|
const entryArray = getFilteredTargetSpec(dependency?.targetSpecs, target).map(s => s[field]);
|
|
8
7
|
const entries = Object.assign({}, ...entryArray);
|
|
9
8
|
Object.entries(entries).forEach(([dKey, value]) => {
|
|
10
9
|
if (field === 'data') {
|
|
11
|
-
|
|
10
|
+
let key;
|
|
11
|
+
if (fs.existsSync(`${dependency.paths.project}/dist/prebuilt/${target.path}`)) {
|
|
12
|
+
key = `${dependency.paths.project}/dist/prebuilt/${target.path}/${dKey}`;
|
|
13
|
+
} else {
|
|
14
|
+
const releaseTarget = getBuildTargets({
|
|
15
|
+
platform: target.platform, arch: target.arch, runtime: target.runtime,
|
|
16
|
+
runtimeEnv: target.runtimeEnv, buildType: 'release'
|
|
17
|
+
})?.[0];
|
|
18
|
+
if (releaseTarget) {
|
|
19
|
+
key = `${dependency.paths.project}/dist/prebuilt/${releaseTarget.path}/${dKey}`;
|
|
20
|
+
} else {
|
|
21
|
+
throw new Error('Data not found');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
12
24
|
obj[key] = value;
|
|
13
25
|
} else {
|
|
14
26
|
if (typeof value === 'object' && Array.isArray(value)) {
|
|
@@ -8,7 +8,7 @@ export default function getDependLibs(target) {
|
|
|
8
8
|
];
|
|
9
9
|
state.config.dependencyParameters.getCmakeDepends(target).forEach((d) => {
|
|
10
10
|
if (d.export.libName) {
|
|
11
|
-
const ignoreLibNames = getFilteredTargetSpec(d?.targetSpecs).map(s => s.ignoreLibName).flat();
|
|
11
|
+
const ignoreLibNames = getFilteredTargetSpec(d?.targetSpecs, target).map(s => s.ignoreLibName).flat();
|
|
12
12
|
d.export.libName.forEach((fileName) => {
|
|
13
13
|
if (ignoreLibNames?.includes(fileName)) return;
|
|
14
14
|
let libPaths = findFiles(`${d.paths.output}/prebuilt/${target.path}/lib/lib${fileName}.a`, { cwd: d.paths.project });
|