diff --git a/README.md b/README.md index 3ad3ff1..f8ffc9e 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 diff --git a/user_cross_compile_setup.cmake b/user_cross_compile_setup.cmake new file mode 100644 index 0000000..ba42189 --- /dev/null +++ b/user_cross_compile_setup.cmake @@ -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") +