Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Cross compiling for Windows on Linux

xvzcf edited this page Jun 10, 2020 · 4 revisions

Step 0: Get pre-requisites

On Ubuntu, you need to install the following packages:

sudo apt install cmake gcc libtool libssl-dev make ninja-build unzip gcc-mingw-w64 git

Then, get source code of this fork (<OPENSSL_DIR> is a directory of your choosing):

git clone --branch OQS-OpenSSL_1_1_1-stable https://github.com/open-quantum-safe/openssl.git <OPENSSL_DIR>

Step 1: Build and install liboqs

git clone --branch master https://github.com/open-quantum-safe/liboqs.git
cd liboqs
mkdir build && cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_windows-amd64.cmake -DCMAKE_INSTALL_PREFIX=<OPENSSL_DIR>/oqs ..
ninja
ninja install

Step 2: Build the fork

Now we follow the standard instructions for building OpenSSL. Navigate to <OPENSSL_DIR>, and:

on Ubuntu, run:

./Configure no-shared mingw64 -lm --cross-compile-prefix=x86_64-w64-mingw32- -Wl,--dynamicbase,--nxcompat -static-libgcc no-capieng
make -j
Clone this wiki locally