Skip to main content

Cross Compiling

Applies to
Windows
MacOS
Linux

Compiling releases for a OS different for the one you are using.

Runtime vs. cross compiling

Using the --runtime argument [Read more] is a great way to tell Velopack what CPU or OS version your software supports, but it does not enable cross compiling by default and if you try to use --runtime linux-x64 on a Windows machine, you will get a "Not Supported" error message.

This is because, by default, Velopack thinks that you are always trying to compile a release for the OS you are currently using.

How to cross compile

Since command line arguments available for each OS are slightly different, you need to explictly opt-in to cross compiling by using using a CLI directive.

The following directives are available:

  • vpk [win]
  • vpk [linux]
  • vpk [osx]

For example, if you wish to compile a linux package while using a Windows machine, you would use the following commands:

  • vpk [linux] -h
  • vpk [linux] pack -h
  • vpk [linux] pack --runtime linux-x64 --mainExe yourExeName --packId YourAppId ...

Before running a command for a different OS, you should review the help text of that command using vpk [os] -h to see the available options.

Supported configurations

  • It is possible to create Windows packages on any OS (Windows, Linux, or MacOS).
  • It is possible to create Linux packages on any OS (Windows, Linux, or MacOS).
  • It is not possible to create MacOS packages on Windows or Linux. Due to the hard dependencies on tools like codesign, xcrun, productbuild and so forth, you must use a MacOS machine to create MacOS packages.

Signing caveat

While you can build a Windows package from Linux or macOS, signing it has additional requirements. The standard --signParams / --signTemplate path relies on signtool.exe, which only runs on Windows. If you need to sign a Windows package from Linux or macOS, use a cross-platform tool such as JSign. See the code signing guide for details.