On Wed, 25 Nov 2020 at 12:23, Thiago Macieira <[email protected]> wrote: > > On Wednesday, 25 November 2020 05:16:58 PST Joerg Bornemann wrote: > > This looks correct so far. A small improvement would be to put all this > > into a CMake toolchain file and additionally do > > set(CMAKE_SYSTEM_NAME Linux) > > > > Then you can cross-build with -DCMAKE_TOOLCHAIN_FILE=x86-toolchain.cmake > > > > In a perfect world, your distro would have provided this file. > > I checked both distros I use and neither does. I suppose CMake itself should > create the toolchain file for multilib builds on Linux if this is a common > occurrence, but seems not to be the case.
Just for the record some time ago I've added /usr/share/cmake/debtoolchainfilegen to cmake (see below). Yes, it's just a distrospecific thing sadly :-/ $ /usr/share/cmake/debtoolchainfilegen arm64 dpkg-architecture: warning: specified GNU system type aarch64-linux-gnu does not match CC system type x86_64-linux-gnu, try setting a correct CC environment variable dpkg-architecture: warning: specified GNU system type aarch64-linux-gnu does not match CC system type x86_64-linux-gnu, try setting a correct CC environment variable # Use it while calling CMake: # mkdir build; cd build # cmake -DCMAKE_TOOLCHAIN_FILE="/path/to/cmake_toolchain_<arch>.cmake" ../ # set(CMAKE_SYSTEM_NAME "Linux") set(CMAKE_SYSTEM_PROCESSOR "aarch64") set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc") set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++") set(PKG_CONFIG_EXECUTABLE "aarch64-linux-gnu-pkg-config") set(PKGCONFIG_EXECUTABLE "aarch64-linux-gnu-pkg-config") set(QMAKE_EXECUTABLE "aarch64-linux-gnu-qmake") -- Lisandro Damián Nicanor Pérez Meyer http://perezmeyer.com.ar/ http://perezmeyer.blogspot.com/ _______________________________________________ Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
