GeniusVentures / thirdparty

2 stars 2 forks source link

This is the repository for third party of SuperGenius

CI/CD Status

WIndows Master OSX Master Linux Master
iOS Master Android Master

Speeding up the build tools

Set two environment variables

Build on Windows

Preinstall

Building for debugging

git pull
git submodule update --init --recursive
cd ./build/Windows
mkdir Debug
cd Debug
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug
cmake --build . --config Debug

Build on Linux

Preinstall

Open a terminal as root ("sudo" without su won't do it because of Ruby installation)

sudo su root

Install default requirements

#!/bin/bash
apt-get -y update
apt-get -y install g++ clang llvm cmake ntp zlib1g-dev libgtk-3-dev ninja-build libjsoncpp25 libsecret-1-0 libjsoncpp-dev libsecret-1-dev git cmake default-jre curl libc++-dev libc++abi-dev
cd /usr/local/src
wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1t.tar.gz 
tar -xf openssl-1.1.1t.tar.gz 
cd openssl-1.1.1t/
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib >build.log 
make install >>build.log
cd ~/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env" 
cargo install cbindgen >rust-install.log 
rustup target add x86_64-unknown-linux-gnu >rust-install.log 
cp -R /root/.cargo /home/$SUDO_USER 
cp -R /root/.rustup /home/$SUDO_USER 
chown -R /$SUDO_USER:/$SUDO_USER /home//$SUDO_USER/.cargo /home//$SUDO_USER/.rustup
apt-get -y install gnupg2
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
curl -sSL https://get.rvm.io | bash -s stable  >>ruby-build.log 
source /etc/profile.d/rvm.sh
rvm install ruby-2.7.8 --with-openssl-dir=/usr/local/ssl/ >>ruby-build.log
rvm --default use ruby-2.7.8 
ln -s /usr/bin/python3 /usr/bin/python
# exit sudo su root
exit
source /etc/profile.d/rvm.sh
# this updates the path
rvm --default use ruby-2.7.8
echo '. "$HOME/.cargo/env"' >> $HOME/.bashrc
# default to use clang
sudo update-alternatives --set c++ /usr/bin/clang++
sudo update-alternatives --set cc /usr/bin/clang

These steps were extracted from the bootstrap.sh script on TestVMS (here)

The following Rust target is needed for now but will be deprecated soon:

export CMAKE_BUILD_PARALLEL_LEVEL=8
export MAKEFLAGS="-j8"
cd ./build/Linux
mkdir Release
cd Release
cmake .. -DCMAKE_BUILD_TYPE=Release
make

Build/Cross-Compile Android on Linux/OSX/Windows Hosts

Preinstall Host tools

Building

cd build/iOS
mkdir Release/
cmake .. -DCMAKE_BUILD_TYPE=Release -DiOS_ABI=arm64-v8a -DIOS_ARCH="arm64" -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1  -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_TOOLCHAIN_FILE=$PWD/../iOS.cmake
make