项目作者: madinina95

项目描述 :
toolchains for developpement
高级语言: CMake
项目地址: git://github.com/madinina95/toolchains.git
创建时间: 2020-04-09T13:55:11Z
项目社区:https://github.com/madinina95/toolchains

开源协议:

下载


TOOLCHAINS

This project contains a toolchain to cross compile on linux a SFML based game on clockworkOS available in GameShell.

with this you can build your SFML game to deploy it on gameshell.
This toolchains has been build with crosstool-ng

The toolchain

The toolchain contains :

Install the toolchain

To install the toolchain :

  • Clone the repo.
  • Execute install.sh script :
    sh install.sh

Build your app

To build your app copy the toolchain-armv7-cpi-linux-gnueabihf.cmake file in your project and build it like this :

  1. cd your-project
  2. mkdir build
  3. cd build
  4. cmake .. -DDCMAKE_TOOLCHAIN_FILE=toolchain-armv7-cpi-linux-gnueabihf.cmake
  5. cmake --build . -- -j 4

Deploy your app

Check your app dependecies

armv7-cpi-linux-gnueabihf-readelf -d your.exe

you will have something like this :

  1. 0x0000000000000001 (NEEDED) Shared library: [libsfml-audio.so.2.5]
  2. 0x0000000000000001 (NEEDED) Shared library: [libsfml-graphics.so.2.5]
  3. 0x0000000000000001 (NEEDED) Shared library: [libsfml-window.so.2.5]
  4. 0x0000000000000001 (NEEDED) Shared library: [libsfml-system.so.2.5]
  5. 0x0000000000000001 (NEEDED) Shared library: [libtinyxml2.so.6]
  6. 0x0000000000000001 (NEEDED) Shared library: [libboost_serialization.so.1.65.1]
  7. 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
  8. 0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
  9. 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
  10. 0x0000000000000001 (NEEDED) Shared library: [libc.so.6]

create a folder lib in your project and copy those dependencies from your toolchain to your lib folder.

Change the rapth

In order to your app search dependencies libs in your folder lib you must modidy it’s rpath.
You can do this with cmake with this option :

set(CMAKE_INSTALL_RPATH "lib")

The rpath will change when you will package your app.

Now you can deploy your app on your gameshell.