Skip to content

Commit

Permalink
feat(cmake): add user cross compile setup
Browse files Browse the repository at this point in the history
  • Loading branch information
YobeZhou authored and kisvegabor committed Feb 6, 2025
1 parent ee4f352 commit cbab3d3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
11 changes: 10 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 @@ -69,11 +68,21 @@ To use EVDEV with fbdev or DRM, adjust `lv_conf.h` as follows:


## cmake
>>>>>>> 5f13fb6 (feat(cmake): add user cross compile setup)
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 cbab3d3

Please sign in to comment.