GuiLite/doc/HowToBuild.md

70 lines
2.6 KiB
Markdown
Raw Normal View History

2019-08-20 10:09:50 +08:00
# How to build & port GuiLite?
## How to build GuiLite libary for Windows?
2019-08-21 13:47:02 +08:00
Prerequisite: Windows & Visul Studio 2013/2015/2017/2019
- Open "GuiLite.sln" by Visual Studio
2017-12-15 22:57:26 +08:00
- Click `Build Solution`
- Output here: \GuiLite\Debug(Release)\GuiLite.lib
2017-12-15 22:57:26 +08:00
2019-08-21 13:47:02 +08:00
FAQ: Error when open GuiLite project with Visual Studio, reconfigure the project to match your computer like this:
![vs-configure](vs-configure.jpg)
## How to build GuiLite libary for iOS/Mac and Linux(amd64) & raspberry pi?
2017-12-15 22:57:26 +08:00
- `cd GuiLite`
- `cmake .`
- `make`
- Output here: /GuiLite/libGuiLite.a
2017-12-15 22:57:26 +08:00
## How to build GuiLite libary for ARM Linux?
2019-01-11 14:00:25 +08:00
### Prerequisite: Install cross compiler:
2018-12-02 22:39:43 +08:00
- For ARM32: `sudo apt-get install g++-arm-linux-gnueabi gcc-arm-linux-gnueabi`
- For ARM64: `sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu`
### Build
2017-12-15 22:57:26 +08:00
- `cd GuiLite`
2018-12-02 22:39:43 +08:00
- For ARM32: `cmake -D CMAKE_C_COMPILER="/usr/bin/arm-linux-gnueabi-gcc" -D CMAKE_CXX_COMPILER="/usr/bin/arm-linux-gnueabi-g++" .`
- For ARM64: `cmake -D CMAKE_C_COMPILER="/usr/bin/aarch64-linux-gnu-gcc" -D CMAKE_CXX_COMPILER="/usr/bin/aarch64-linux-gnu-g++" .`
2017-12-15 22:57:26 +08:00
- `make`
- Output here: /GuiLite/libGuiLite.a
2017-12-15 22:57:26 +08:00
## How to build GuiLite libary for Android?
2019-01-11 14:00:25 +08:00
### Prerequisite: Install cross compiler:
2018-01-29 18:49:29 +08:00
`sudo apt-get install gcc-arm-linux-androideabi`
2019-01-11 14:00:25 +08:00
### Build
2017-12-15 22:57:26 +08:00
- `cd GuiLite`
- `cmake -D CMAKE_C_COMPILER="/usr/bin/arm-linux-androideabi-gcc" -D CMAKE_CXX_COMPILER="/usr/bin/arm-linux-androideabi-g++" .`
- `make`
- Output here: /GuiLite/libGuiLite.a
2019-01-11 14:00:25 +08:00
2019-01-29 11:41:15 +08:00
## How to build GuiLite libary for any MCU?
2019-01-11 14:00:25 +08:00
### Prerequisite: Install Keil uvsion 5.6 or above.
### Build
- Open `GuiLite.uvprojx` with Keil uvsion.
2019-01-29 11:41:15 +08:00
- Implement function(e.g, thread_sleep) in `core\src\adapter\api_unknow.cpp` to meet your need.
2019-01-11 14:00:25 +08:00
- Choose your Device type(Default: STM32F103ZE) from option for target.
- Build GuiLite.
- Output here: /GuiLite/Objects/GuiLite.lib
2019-08-20 10:09:50 +08:00
## How to port?
Here are 2 options for porting.
2019-08-20 10:09:50 +08:00
### Option 1: 1 Header & 1 Source
1. Execute `1h-1cpp.sh` to merge the whole source code into: 1 header(GuiLite.h) & 1 source(GuiLite.cpp)
2. Move GuiLite.h/GuiLite.cpp to your project
3. Rebuild your project
2019-08-20 10:09:50 +08:00
### Option 2: Headers & 1 Library
2019-08-20 10:09:50 +08:00
- Headers: core_include, widgets_include
- Library: The GuiLite library
1. Move core_include/widgets_include to your project
2. Build GuiLite library by above building process
3. Link GuiLite library to your project
4. Rebuild your project
We recommend option 1, because of:
- Easy to port - no need to buid library
- Easy to move - just 2 files
- Easy to manage header files - just 1 header file
- Easy to debug - no library binary
On the other hand, for option 2: you should build GuiLite library, and move all headers files & library to your project.