zodsoft / hello-cross-platform

Get started with C++ cross-platform app (Android, iOS, macOS, windows, linux, ...)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hello-cross-platform

This repository is used to demonstrate how to build a cross-platform application with C/C++ & CMake

https://medium.com/@huynhtanngan/cross-platform-c-c-development-android-ios-windows-macos-linux-c87cc5643950

Software requirement

Install python3, jinja2 https://pypi.org/project/Jinja2/

MacOS/Linux

Install GCC, G++ and Clang/LLVM.

Windows

Install Cygwin https://www3.ntu.edu.sg/home/ehchua/programming/howto/Cygwin_HowTo.html

Make sure you have installed the gcc, g++, cmake packages and setup environment variable

Android

Install Android SDK, NDK and CMake toolchain https://developer.android.com/studio/projects/install-ndk

iOS

Install Xcode

Build project

Windows:

 runner.bat build -platform windows

MacOS: 

./runner build -platform osx

Linux: 

./runner build -platform linux

Android: 

./runner build -platform android

iOS: 

./runner build -platform ios

Note: If you want to test iOS app on real device instead of simulator, you must sign exampleapp & helloworld framework

Clean project

./runner clean

Project structure

src/ directory

Containing shared code base for different platforms

tool/ directory

A small python script, used to compile applications for different platforms

cmake/ directory

CMake utilities

About

Get started with C++ cross-platform app (Android, iOS, macOS, windows, linux, ...)


Languages

Language:CMake 49.7%Language:Python 34.4%Language:Objective-C 5.4%Language:C++ 5.3%Language:Kotlin 1.7%Language:Objective-C++ 1.7%Language:HTML 1.2%Language:Java 0.4%Language:Shell 0.2%Language:Batchfile 0.0%