cpp.js 1.0.0-beta.27 → 1.0.0-beta.29

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cpp.js",
3
- "version": "1.0.0-beta.27",
3
+ "version": "1.0.0-beta.29",
4
4
  "license": "MIT",
5
5
  "homepage": "https://cpp.js.org",
6
6
  "repository": "https://github.com/bugra9/cpp.js.git",
@@ -1,17 +1,19 @@
1
1
  /* eslint-disable prefer-destructuring */
2
2
  import fs from 'node:fs';
3
+ import upath from 'upath';
3
4
  import state, { saveCache } from '../state/index.js';
4
5
  import { getFileHash } from '../utils/hash.js';
5
6
  import run from './run.js';
6
7
 
7
8
  export default function createBridgeFile(headerOrModuleFilePath) {
9
+ const interfaceFilePath = upath.resolve(headerOrModuleFilePath);
8
10
  if (!fs.existsSync(`${state.config.paths.build}/interface`)) {
9
11
  fs.mkdirSync(`${state.config.paths.build}/interface`, { recursive: true });
10
12
  }
11
13
  if (!fs.existsSync(`${state.config.paths.build}/bridge`)) {
12
14
  fs.mkdirSync(`${state.config.paths.build}/bridge`, { recursive: true });
13
15
  }
14
- const interfaceFile = createInterfaceFile(headerOrModuleFilePath);
16
+ const interfaceFile = createInterfaceFile(interfaceFilePath);
15
17
  return createBridgeFileFromInterfaceFile(interfaceFile);
16
18
  }
17
19
 
@@ -13,11 +13,11 @@ export default function getCmakeParameters(platform, options = {}) {
13
13
  ...(options.nativeGlob || []),
14
14
  ];
15
15
  const externalBridgeGlob = [
16
- `${state.config.paths.cli}/assets/bridge.cpp`,
16
+ `${state.config.paths.cli}/assets/commonBridges.cpp`,
17
17
  ...(options.bridgeGlob || []),
18
18
  ];
19
19
  const nativeGlob = [
20
- `${state.config.paths.cli}/assets/cppjsemptysource.cpp`,
20
+ `${state.config.paths.cli}/assets/cppjsEmptySource.cpp`,
21
21
  ...(dependParams.nativeGlob || []),
22
22
  ];
23
23
  const headerGlob = [
@@ -1,7 +1,6 @@
1
1
  #include <emscripten/bind.h>
2
2
 
3
- EMSCRIPTEN_BINDINGS(stl_wrappers) {
4
- emscripten::register_vector<bool>("VectorBool");
3
+ EMSCRIPTEN_BINDINGS(CommonBridges) {
5
4
  emscripten::register_vector<char>("VectorChar");
6
5
  emscripten::register_vector<short>("VectorShort");
7
6
  emscripten::register_vector<int>("VectorInt");
@@ -9,7 +9,7 @@ if(ANDROID)
9
9
  set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}/${PACKAGE_HOST}/lib")
10
10
  elseif(APPLE)
11
11
  if (CMAKE_SYSTEM_NAME STREQUAL "iOS")
12
- set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}")
12
+ set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}/../..")
13
13
  else()
14
14
  set(PACKAGE_HOST "${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}")
15
15
  set(PACKAGE_DIR "${PROJECT_SOURCE_DIR}/${PACKAGE_HOST}/lib")
package/src/bin.js CHANGED
@@ -303,7 +303,10 @@ async function createWasmJs() {
303
303
  const opt = {
304
304
  isProd: true,
305
305
  buildSource: false,
306
- nativeGlob: bridges,
306
+ nativeGlob: [
307
+ `${state.config.paths.cli}/assets/commonBridges.cpp`,
308
+ ...bridges,
309
+ ],
307
310
  };
308
311
  createLib('Emscripten-x86_64', 'Bridge', opt);
309
312