You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each option accepts a comma-separated list. When an option is omitted, all valid values are selected (except `wasm64`, which is opt-in).
17
+
12
18
<br />
13
19
14
20
**Output**
21
+
22
+
The build outputs platform-specific artifacts under `dist/prebuilt/<platform>-<arch>-<runtime>-<buildType>/`. For each WebAssembly target, the corresponding `.js` and `.wasm` files are also emitted with the runtime environment (browser, edge, node) embedded in the file name.
23
+
15
24
```
16
25
├── dist
17
-
│ ├── mylib.wasm
18
-
│ ├── mylib.browser.js
19
-
│ ├── mylib.node.js
26
+
│ ├── mylib-wasm-wasm32-st-release.browser.js
27
+
│ ├── mylib-wasm-wasm32-st-release.browser.wasm
28
+
│ ├── mylib-wasm-wasm32-st-release.edge.js
29
+
│ ├── mylib-wasm-wasm32-st-release.edge.wasm
30
+
│ ├── mylib-wasm-wasm32-st-release.node.js
31
+
│ ├── mylib-wasm-wasm32-st-release.node.wasm
32
+
│ ├── mylib-wasm-wasm32-mt-release.browser.js
33
+
│ ├── mylib-wasm-wasm32-mt-release.browser.wasm
34
+
│ ├── mylib-wasm-wasm32-mt-release.node.js
35
+
│ ├── mylib-wasm-wasm32-mt-release.node.wasm
20
36
│ └── prebuilt
21
-
│ ├── Android-arm64-v8a
37
+
│ ├── wasm-wasm32-st-release
22
38
│ │ ├── include
23
39
│ │ │ └── ...
24
40
│ │ └── lib
25
-
│ │ └── mylib.so
41
+
│ │ └── libmylib.a
26
42
│ │
27
-
│ ├── Android-x86_64
43
+
│ ├── wasm-wasm32-mt-release
28
44
│ │ ├── include
29
45
│ │ │ └── ...
30
46
│ │ └── lib
31
-
│ │ └── mylib.so
47
+
│ │ └── libmylib.a
32
48
│ │
33
-
│ ├── Emscripten-x86_64
49
+
│ ├── android-arm64-v8a-mt-release
34
50
│ │ ├── include
35
51
│ │ │ └── ...
36
52
│ │ └── lib
37
-
│ │ └── mylib.a
53
+
│ │ └── libmylib.a
38
54
│ │
39
-
│ ├── iOS-iphoneos
55
+
│ ├── android-x86_64-mt-release
40
56
│ │ ├── include
41
57
│ │ │ └── ...
42
58
│ │ └── lib
43
-
│ │ └── mylib.a
59
+
│ │ └── libmylib.a
44
60
│ │
45
-
│ ├── iOS-iphonesimulator
61
+
│ ├── ios-iphoneos-mt-release
46
62
│ │ ├── include
47
63
│ │ │ └── ...
48
64
│ │ └── lib
49
-
│ │ └── mylib.a
65
+
│ │ └── libmylib.a
66
+
│ │
67
+
│ ├── ios-iphonesimulator-mt-release
68
+
│ │ ├── include
69
+
│ │ │ └── ...
70
+
│ │ └── lib
71
+
│ │ └── libmylib.a
50
72
│ │
51
-
│ ├── mylib.xcframework.zip
52
73
│ └── CMakeLists.txt
53
74
|
54
75
└── mylib.xcframework
55
76
├── ios-arm64_arm64e
56
77
│ ├── Headers
57
78
│ │ └── ...
58
-
│ └── mylib.a
79
+
│ └── libmylib.a
59
80
│
60
-
├── ios-arm64_arm64e_x86_64-simulator
81
+
├── ios-arm64_x86_64-simulator
61
82
│ ├── Headers
62
83
│ │ └── ...
63
-
│ └── mylib.a
84
+
│ └── libmylib.a
64
85
│
65
86
└── Info.plist
66
-
67
87
```
68
88
69
-
Here is a minimal example:
89
+
Here is a minimal example that builds only the WebAssembly targets:
70
90
71
91
```json title="package.json"
72
92
{
73
93
"name": "cf-worker-example",
74
94
"scripts": {
75
-
"build": "cppjs build -p WebAssembly"
95
+
"build": "cppjs build -p wasm"
76
96
}
77
97
}
78
98
```
79
99
100
+
A more targeted invocation that limits the architecture, runtime, build type, and runtime environment:
101
+
102
+
```sh
103
+
cppjs build -p wasm -a wasm32 -r st -b release -e browser,node
104
+
```
105
+
80
106
:::info
81
-
**Create library function:** You can access the create library function from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/functions/createLib.js).
82
-
**Create webassembly function:** You can access the create webassembly function from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/functions/createWasm.js).
107
+
**Create library function:** You can access the create library function from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/actions/createLib.js).
108
+
**Build WebAssembly function:** You can access the build WebAssembly function from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/actions/buildWasm.js).
109
+
**Create XCFramework function:** You can access the create XCFramework function from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/actions/createXCFramework.js).
Copy file name to clipboardExpand all lines: website/docs/api/configuration/overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ export default {
12
12
};
13
13
```
14
14
15
-
The configuration object consists of six sections. These are:
15
+
The configuration object consists of the sections below. These are:
16
16
17
17
| Attribute | Description |
18
18
| - | - |
@@ -21,10 +21,10 @@ The configuration object consists of six sections. These are:
21
21
| paths | This object defines paths, such as the project path |
22
22
| ext | This object specifies file extensions, including those for header files. |
23
23
| export | This object includes configurations related to lib generation. |
24
-
|platform | This object includes platform-specific configuration. |
24
+
|targetSpecs | This array includes target-specific configuration filtered by platform/arch/runtime/buildType. |
25
25
26
26
<br />
27
27
28
28
:::tip
29
-
You can find the JavaScript file that generates the configuration [here.](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/utils/getConfig.js)
29
+
You can find the JavaScript file that generates the configuration [here.](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/state/loadConfig.js)
This object includes platform-specific configuration.
1
+
# Target Specs
2
+
This array includes target-specific configuration. Each entry filters by any combination of `platform`, `arch`, `runtime`, `buildType`, and `runtimeEnv`, and applies its `specs` block to every build target that matches the filter. Omit a field to match all of its values.
Copy file name to clipboardExpand all lines: website/docs/api/cpp-bindings/overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The table below outlines the headings discussed in this section.
15
15
<br />
16
16
17
17
:::info
18
-
[Embind](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html) is utilized to bind C++ functions and classes to JavaScript. In WebAssembly, this functionality is provided by Emscripten. In React Native, the binding is achieved through the [@cpp.js/core-embind-jsi](https://github.com/bugra9/cpp.js/tree/main/packages/cppjs-core-embind-jsi) project, which replaces WebAssembly bindings with JavaScript Interface (JSI).
18
+
[Embind](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html) is utilized to bind C++ functions and classes to JavaScript. In WebAssembly, this functionality is provided by Emscripten. In React Native, the binding is achieved through the [@cpp.js/core-embind-jsi](https://github.com/bugra9/cpp.js/tree/main/cppjs-core/cppjs-core-embind-jsi) project, which replaces WebAssembly bindings with JavaScript Interface (JSI).
19
19
20
20
The [bugra9/swig](https://github.com/bugra9/swig/tree/add-embind-support) project, a fork of the original [Swig](https://github.com/swig/swig) project adapted to support Embind, is used to create Embind definitions.
Copy file name to clipboardExpand all lines: website/docs/api/javascript/filesystem.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,6 @@ files.forEach((fileInfo) => {
65
65
<br />
66
66
67
67
:::info
68
-
**Browser Functions:** You can access the browser functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/assets/browser.js).
69
-
**Node.js Functions:** You can access the Node.js functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/assets/node.js).
68
+
**Browser Functions:** You can access the browser functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/assets/browser.js).
69
+
**Node.js Functions:** You can access the Node.js functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/assets/node.js).
Copy file name to clipboardExpand all lines: website/docs/api/javascript/overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Cpp.js includes helper JavaScript functions to handle cross-platform differences
26
26
<br />
27
27
28
28
:::info
29
-
**Browser Functions:** You can access the browser functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/assets/browser.js).
30
-
**Node.js Functions:** You can access the Node.js functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/assets/node.js).
31
-
**React Native Functions:** You can access the React Native functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cppjs-core-embind-jsi/js/embind.js).
29
+
**Browser Functions:** You can access the browser functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/assets/browser.js).
30
+
**Node.js Functions:** You can access the Node.js functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/assets/node.js).
31
+
**React Native Functions:** You can access the React Native functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cppjs-core-embind-jsi/js/embind.js).
**Browser Functions:** You can access the browser functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/assets/browser.js).
21
-
**Node.js Functions:** You can access the Node.js functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cpp.js/src/assets/node.js).
22
-
**React Native Functions:** You can access the React Native functions from [this link](https://github.com/bugra9/cpp.js/blob/main/packages/cppjs-core-embind-jsi/js/embind.js).
20
+
**Browser Functions:** You can access the browser functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/assets/browser.js).
21
+
**Node.js Functions:** You can access the Node.js functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cpp.js/src/assets/node.js).
22
+
**React Native Functions:** You can access the React Native functions from [this link](https://github.com/bugra9/cpp.js/blob/main/cppjs-core/cppjs-core-embind-jsi/js/embind.js).
0 commit comments