Skip to main content

Platform

This object includes platform-specific configuration.

Here is a minimal example:

import getDirName from 'cpp.js/src/utils/getDirName.js';

export default {
platform: {
'Emscripten-x86_64': {
ignoreLibName: ['charset'],
},
'Android-arm64-v8a': {
data: {
'share/proj': 'proj',
},
env: {
PROJ_LIB: '_CPPJS_DATA_PATH_/proj',
},
},
},
paths: {
project: getDirName(import.meta.url),
},
};

Attributes (Platforms)

Platforms
Emscripten-x86_64
Emscripten-x86_64-browser
Emscripten-x86_64-node
Android-arm64-v8a
iOS-iphoneos
iOS-iphonesimulator

Sub-Attributes

NameTypeDescription
dataobjectCopy local file to platform. key: local path, value: target path
envobjectSet environment variables
ignoreLibNamearrayLibraries not included in the linked project

tip

Below are examples demonstrating various uses of the configurations.