JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4888
  • Score
    100M100P100Q117152F
  • License MIT

cmake-js rewrite in typescript to support advanced build configurations

Package Exports

  • cmake-ts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cmake-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cmake-ts

A CMake based build system for native NodeJS and Electron addons. This project is loosely inspired by cmake-js but attempts to fix several design flaws.

It is intended to prebuild addons for different versions of nodejs and electron and ship a binary version.

Configuration

Configuration is done entirely via package.json, you can specify multiple build configurations under the cmake-ts key:

"cmake-ts": {
  "configurations": [
    {
      "os": "win32", // win32, linux and darwin are supported
      "arch": "x64", // x64, x86 should work
      "runtime": "electron", // node or electron
      "runtimeVersion": "4.0.1", // Version of the runtime which it is built
      "toolchainFile": "/windows.cmake" // CMake Toolchain file to use for crosscompiling
    } // more build configurations ...
  ],
  "targetDirectory": "build", // where to build your project
  "buildType": "Release", // Debug or Release build, most likely set it to Release
  "projectName": "addon" // The name of your CMake project.
}

Cross Compilation

This module supports cross-compilation from Linux to MacOS and Windows, givena correct toolchain setup. There is a docker container which has a cross-toolchain based on CLang 7 setup for Windows and MacOS which might be used in a CI.

NOTE: Due to legal issues which I'm currently trying to solve, I can't provide the docker container here. You might want to checkout the osxcross project or the LLVM windows toolchain file.