Skip to content

Commit

Permalink
feat(cmake): add user cross compile setup (#70)
Browse files Browse the repository at this point in the history
* feat(cmake): add user cross compile setup

* Update README.md

---------

Co-authored-by: YobeZhou <[email protected]>
  • Loading branch information
kisvegabor and YobeZhou authored Feb 6, 2025
1 parent ee4f352 commit e535225
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ To use wayland, adjust `lv_conf.h` as follows:
#define LV_USE_WAYLAND 1
```


## Enable Input

To use EVDEV with fbdev or DRM, adjust `lv_conf.h` as follows:
Expand All @@ -70,10 +69,19 @@ To use EVDEV with fbdev or DRM, adjust `lv_conf.h` as follows:

## cmake

1. gcc compiler:

```
cmake -B build -S .
make -C build -j
```
2. Cross compiler:

```
vim ./user_cross_compile_setup.cmake
cmake -DCMAKE_TOOLCHAIN_FILE=./user_cross_compile_setup.cmake -B build -S .
make -C build -j
```

## Makefile

Expand Down
15 changes: 15 additions & 0 deletions user_cross_compile_setup.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Usage:
# cmake -DCMAKE_TOOLCHAIN_FILE=./user_cross_compile_setup.cmake -B build -S .
# make -C build -j

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(tools /home/ubuntu/Your_SDK/prebuilt/rootfsbuilt/arm/toolchain-glibc-gcc/toolchain)
set(CMAKE_C_COMPILER ${tools}/bin/arm-openwrt-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-openwrt-linux-gnueabi-g++)

# If necessary, set STAGING_DIR
# if not work, please try(in shell command): export STAGING_DIR=/home/ubuntu/Your_SDK/out/xxx/openwrt/staging_dir/target
#set(ENV{STAGING_DIR} "/home/ubuntu/Your_SDK/out/xxx/openwrt/staging_dir/target")

0 comments on commit e535225

Please sign in to comment.