Skip to content

Instantly share code, notes, and snippets.

@jamesonwilliams
Last active October 25, 2022 05:18
Show Gist options
  • Save jamesonwilliams/81b6f69117b3017f1459d2a6e198345f to your computer and use it in GitHub Desktop.
Save jamesonwilliams/81b6f69117b3017f1459d2a6e198345f to your computer and use it in GitHub Desktop.
Notes on Cross Compiling Zebra Crossing (zxing) CPP Port for ARM64

ARM64 Build Notes for zxing-cpp

Clone glassechidna's zxing-cpp fork.

In CMakeLists.txt, add include(toolchain.cmake) as the first line.

Create a new file, toolchain.cmake:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)

set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

Make a build directory, run cmake, and build with make:

mkdir build
cd build
cmake -g "Unix Makefiles" ../
make -j10

Also can explore nu-book's more recently maintained fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment