diff --git a/core/shared-lib/include/config.h b/core/shared-lib/include/config.h index 14f379c7..0cf7bd4f 100644 --- a/core/shared-lib/include/config.h +++ b/core/shared-lib/include/config.h @@ -98,7 +98,11 @@ #define APP_HEAP_SIZE_MAX (1024 * 1024) /* Default wasm stack size of each app */ +#ifdef __x86_64__ +#define DEFAULT_WASM_STACK_SIZE (12 * 1024) +#else #define DEFAULT_WASM_STACK_SIZE (8 * 1024) +#endif /* Default/min/max stack size of each app thread */ #ifndef __ZEPHYR__ diff --git a/samples/gui/README.md b/samples/gui/README.md index f4615118..3bfd18dd 100644 --- a/samples/gui/README.md +++ b/samples/gui/README.md @@ -11,19 +11,37 @@ The sample also provides the native Linux version of application without the run The number on top will plus one each second, and the number on the bottom will plus one when clicked. +Configure 32 bit or 64 bit build +============== +On 64 bit operating system, there is an option to build 32 bit or 64 bit binaries. In file `./lvgl-native-ui-app/CMakeLists.txt` and/or `./wasm-runtime-wgl/linux-build/CMakeLists.txt` , modify the line: +`set (BUILD_AS_64BIT_SUPPORT "YES")` + where `YES` means 64 bit build while `NO` means 32 bit build. + Install required SDK and libraries ============== -- 32 bit SDL(simple directmedia layer) -Use apt-get - `sudo apt-get install libsdl2-dev:i386` -Or download source from www.libsdl.org - `./configure C_FLAGS=-m32 CXX_FLAGS=-m32 LD_FLAGS=-m32` - `make` - `sudo make install` +- 32 bit SDL(simple directmedia layer) (Note: only necessary when `BUILD_AS_64BIT_SUPPORT` is set to `NO`) +Use apt-get: + `sudo apt-get install libsdl2-dev:i386` +Or download source from www.libsdl.org: +``` +./configure C_FLAGS=-m32 CXX_FLAGS=-m32 LD_FLAGS=-m32 +make +sudo make install +``` +- 64 bit SDL(simple directmedia layer) (Note: only necessary when `BUILD_AS_64BIT_SUPPORT` is set to `YES`) +Use apt-get: + `sudo apt-get install libsdl2-dev` +Or download source from www.libsdl.org: +``` +./configure +make +sudo make install +``` + - Install EMSDK -
+```
https://emscripten.org/docs/tools_reference/emsdk.html
-
+```
Build and Run
==============
diff --git a/samples/gui/build.sh b/samples/gui/build.sh
index 6d01f9dd..a88987ad 100755
--- a/samples/gui/build.sh
+++ b/samples/gui/build.sh
@@ -18,6 +18,14 @@ if [ ! -d "tlsf" ]; then
git clone https://github.com/mattconte/tlsf
fi
+cd ${WAMR_DIR}/core/iwasm/lib/3rdparty
+if [ ! -d "lvgl" ]; then
+ git clone https://github.com/littlevgl/lvgl.git --branch v6.0.1
+fi
+if [ ! -d "lv_drivers" ]; then
+ git clone https://github.com/littlevgl/lv_drivers.git
+fi
+
echo "##################### 1. build native-ui-app start#####################"
cd $BUILD_DIR
mkdir -p lvgl-native-ui-app
diff --git a/samples/gui/lvgl-native-ui-app/CMakeLists.txt b/samples/gui/lvgl-native-ui-app/CMakeLists.txt
index ddf4acde..95550afc 100644
--- a/samples/gui/lvgl-native-ui-app/CMakeLists.txt
+++ b/samples/gui/lvgl-native-ui-app/CMakeLists.txt
@@ -17,36 +17,32 @@ message ("lvgl_native_ui_app...")
project (lvgl_native_ui_app)
#################################################################
-#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -g)
-set(lv_name lvgl)
-set(lv_drivers_name lv_drivers)
-set(LVGL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${lv_name})
-set(LVGL_DRIVER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${lv_drivers_name})
+# Currently build as 64-bit by default. Set to "NO" to build 32-bit binaries.
+set (BUILD_AS_64BIT_SUPPORT "YES")
-if ((NOT EXISTS ${LVGL_SOURCE_DIR}) OR (NOT EXISTS ${LVGL_DRIVER_DIR}))
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl/CMakeLists.txt)
+if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES")
+ # Add -fPIC flag if build as 64-bit
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+ set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC")
+ else ()
+ add_definitions (-m32)
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
+ endif ()
+endif ()
- execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl )
- if(result)
- message(FATAL_ERROR "CMake step for lvgl failed: ${result}")
- endif()
- execute_process(COMMAND ${CMAKE_COMMAND} --build .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl )
- if(result)
- message(FATAL_ERROR "Build step for lvgl failed: ${result}")
- endif()
-endif()
+set(THIRDPARTY_DIR ../../../core/iwasm/lib/3rdparty)
+set(LVGL_SOURCE_DIR ${THIRDPARTY_DIR}/lvgl)
+set(LVGL_DRIVER_DIR ${THIRDPARTY_DIR}/lv_drivers)
#################################
-set(CMAKE_C_STANDARD 11)#C11
-set(CMAKE_CXX_STANDARD 17)#C17
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
+INCLUDE_DIRECTORIES(${THIRDPARTY_DIR})
+
+add_definitions (-DLV_CONF_INCLUDE_SIMPLE)
file(GLOB_RECURSE INCLUDES "${LVGL_DRIVER_DIR}/*.h" "${LVGL_SOURCE_DIR}/*.h" "./*.h" )
file(GLOB_RECURSE SOURCES "${LVGL_DRIVER_DIR}/*.c" "${LVGL_SOURCE_DIR}/*.c" )
diff --git a/samples/gui/lvgl-native-ui-app/CMakeLists.txt.in b/samples/gui/lvgl-native-ui-app/CMakeLists.txt.in
deleted file mode 100644
index 1f777113..00000000
--- a/samples/gui/lvgl-native-ui-app/CMakeLists.txt.in
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 2019 Intel Corporation. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cmake_minimum_required(VERSION 2.8.2)
-
-project(lvgl_download NONE)
-
-include(ExternalProject)
-ExternalProject_Add(${lv_name}
- GIT_REPOSITORY https://github.com/littlevgl/lvgl.git
- GIT_TAG "v6.0"
- BINARY_DIR ""
- SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${lv_name}"
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND ""
- )
-
-ExternalProject_Add(${lv_drivers_name}
- GIT_REPOSITORY https://github.com/littlevgl/lv_drivers.git
- GIT_TAG ""
- BINARY_DIR ""
- SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${lv_drivers_name}"
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND ""
- )
diff --git a/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt b/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt
index b27c9285..5869052d 100644
--- a/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt
+++ b/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt
@@ -7,27 +7,8 @@ set(WASM_DIR ${REPO_ROOT_DIR}/core/iwasm)
set(APP_MGR_DIR ${REPO_ROOT_DIR}/core/app-mgr)
set(SHARED_DIR ${REPO_ROOT_DIR}/core/shared-lib)
-set (lv_drivers_name lv_drivers)
-set (lv_name lvgl)
-set (LV_DRIVERS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/linux/${lv_drivers_name})
-set (LVGL_DIR ${WASM_DIR}/lib/3rdparty/${lv_name})
-
-if ((NOT EXISTS ${LVGL_DIR}) OR (NOT EXISTS ${LV_DRIVERS_DIR}))
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl_drivers/CMakeLists.txt)
-
- execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl_drivers )
- if(result)
- message(FATAL_ERROR "CMake step for lvgl drivers failed: ${result}")
- endif()
- execute_process(COMMAND ${CMAKE_COMMAND} --build .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl_drivers )
- if(result)
- message(FATAL_ERROR "Build step for lvgl drivers failed: ${result}")
- endif()
-endif()
+set (LV_DRIVERS_DIR ${WASM_DIR}/lib/3rdparty/lv_drivers)
+set (LVGL_DIR ${WASM_DIR}/lib/3rdparty/lvgl)
file(GLOB_RECURSE LV_DRIVERS_SOURCES "${LV_DRIVERS_DIR}/*.c" )
@@ -95,10 +76,12 @@ include (${SHARED_DIR}/coap/lib_coap.cmake)
set (PROJECT_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/../src/platform/${TARGET_PLATFORM})
include_directories(${SHARED_DIR}/include)
+include_directories(${PROJECT_SRC_DIR})
add_definitions (-DWASM_ENABLE_BASE_LIB)
add_definitions (-Dattr_container_malloc=bh_malloc)
add_definitions (-Dattr_container_free=bh_free)
+add_definitions (-DLV_CONF_INCLUDE_SIMPLE)
add_library (vmlib
${WASM_PLATFORM_LIB_SOURCE}
diff --git a/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt.in b/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt.in
deleted file mode 100644
index c250efc5..00000000
--- a/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt.in
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2019 Intel Corporation. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cmake_minimum_required(VERSION 2.8.2)
-
-project(lvgl_download NONE)
-
-include(ExternalProject)
-
-ExternalProject_Add(${lv_name}
- GIT_REPOSITORY https://github.com/littlevgl/lvgl.git
- GIT_TAG ""
- BINARY_DIR ""
- SOURCE_DIR "${LVGL_DIR}"
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND ""
- )
-
-ExternalProject_Add(${lv_drivers_name}
- GIT_REPOSITORY https://github.com/littlevgl/lv_drivers.git
- GIT_TAG ""
- BINARY_DIR ""
- SOURCE_DIR "${LV_DRIVERS_DIR}"
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND ""
- )
diff --git a/samples/littlevgl/README.md b/samples/littlevgl/README.md
index 3c503b6e..18e2527f 100644
--- a/samples/littlevgl/README.md
+++ b/samples/littlevgl/README.md
@@ -21,19 +21,38 @@ The sample also provides the native Linux version of application without the run
The number on top will plus one each second, and the number on the bottom will plus one when clicked.
+Configure 32 bit or 64 bit build
+==============
+On 64 bit operating system, there is an option to build 32 bit or 64 bit binaries. In file `./vgl-native-ui-app/CMakeLists.txt` and/or `./vgl-wasm-runtime/CMakeLists.txt` , modify the line:
+`set (BUILD_AS_64BIT_SUPPORT "YES")`
+ where `YES` means 64 bit build while `NO` means 32 bit build.
+
Install required SDK and libraries
==============
-- 32 bit SDL(simple directmedia layer)
-Use apt-get
- `sudo apt-get install libsdl2-dev:i386`
-Or download source from www.libsdl.org
- `./configure C_FLAGS=-m32 CXX_FLAGS=-m32 LD_FLAGS=-m32`
- `make`
- `sudo make install`
+- 32 bit SDL(simple directmedia layer) (Note: only necessary when `BUILD_AS_64BIT_SUPPORT` is set to `NO`)
+Use apt-get:
+ `sudo apt-get install libsdl2-dev:i386`
+Or download source from www.libsdl.org:
+```
+./configure C_FLAGS=-m32 CXX_FLAGS=-m32 LD_FLAGS=-m32
+make
+sudo make install
+```
+- 64 bit SDL(simple directmedia layer) (Note: only necessary when `BUILD_AS_64BIT_SUPPORT` is set to `YES`)
+Use apt-get:
+ `sudo apt-get install libsdl2-dev`
+Or download source from www.libsdl.org:
+```
+./configure
+make
+sudo make install
+```
+
- Install EMSDK
-
+```
https://emscripten.org/docs/tools_reference/emsdk.html
-
+```
+
Build and Run
==============
diff --git a/samples/littlevgl/build.sh b/samples/littlevgl/build.sh
index f8a42bf0..7bdae298 100755
--- a/samples/littlevgl/build.sh
+++ b/samples/littlevgl/build.sh
@@ -18,6 +18,12 @@ if [ ! -d "tlsf" ]; then
git clone https://github.com/mattconte/tlsf
fi
+cd ${WAMR_DIR}/core/iwasm/lib/3rdparty
+if [ ! -d "lvgl" ]; then
+ git clone https://github.com/littlevgl/lvgl.git --branch v6.0.1
+fi
+
+
echo "##################### 1. build native-ui-app start#####################"
cd $BUILD_DIR
mkdir -p vgl-native-ui-app
diff --git a/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt b/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt
index 56e9d5de..78f64645 100644
--- a/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt
+++ b/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt
@@ -17,7 +17,22 @@ message ("vgl_native_ui_app...")
project (vgl_native_ui_app)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -g -DLV_CONF_INCLUDE_SIMPLE -DPLATFORM_NATIVE_LINUX -DUSE_MONITOR -DUSE_MOUSE=1")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLV_CONF_INCLUDE_SIMPLE -DPLATFORM_NATIVE_LINUX -DUSE_MONITOR -DUSE_MOUSE=1")
+
+# Currently build as 64-bit by default. Set to "NO" to build 32-bit binaries.
+set (BUILD_AS_64BIT_SUPPORT "YES")
+
+if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES")
+ # Add -fPIC flag if build as 64-bit
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+ set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC")
+ else ()
+ add_definitions (-m32)
+ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
+ endif ()
+endif ()
set(lv_name lvgl)
set(LVGL_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${lv_name})
diff --git a/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt b/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt
index 9f2f29a7..69114070 100644
--- a/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt
+++ b/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt
@@ -15,8 +15,8 @@ if (NOT ("$ENV{VALGRIND}" STREQUAL "YES"))
add_definitions(-DNVALGRIND)
endif ()
-# Currently build as 32-bit by default.
-set (BUILD_AS_64BIT_SUPPORT "NO")
+# Currently build as 64-bit by default.
+set (BUILD_AS_64BIT_SUPPORT "YES")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES")
diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c
index 6aeaec19..f7d8b5cc 100644
--- a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c
+++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c
@@ -186,12 +186,29 @@ void display_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
bool display_input_read(int32 data_p_offset)
{
+ bool ret;
wasm_module_inst_t module_inst = wasm_runtime_get_current_module_inst();
if (!wasm_runtime_validate_app_addr(module_inst, data_p_offset, 1))
return false;
- lv_indev_data_t * data = wasm_runtime_addr_app_to_native(module_inst,
- data_p_offset);
- return mouse_read(data);
+
+ struct {
+ lv_point_t point;
+ int32 user_data_offset;
+ uint8 state;
+ } *data_app;
+
+ lv_indev_data_t data;
+
+ ret = mouse_read(&data);
+
+ data_app = wasm_runtime_addr_app_to_native(module_inst,
+ data_p_offset);
+
+ data_app->point = data.point;
+ data_app->user_data_offset = (int32_t)data.user_data;
+ data_app->state = data.state;
+
+ return ret;
}
void display_deinit(void)
diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/iwasm_main.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/iwasm_main.c
index 15d94d30..68b42b3c 100644
--- a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/iwasm_main.c
+++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/iwasm_main.c
@@ -343,7 +343,11 @@ static host_interface interface = { .send = uart_send, .destroy = uart_destroy }
#endif
+#ifdef __x86_64__
+static char global_heap_buf[300 * 1024] = { 0 };
+#else
static char global_heap_buf[270 * 1024] = { 0 };
+#endif
static void showUsage()
{
diff --git a/samples/simple/CMakeLists.txt b/samples/simple/CMakeLists.txt
index 3dbf1a1f..e5c4e18b 100644
--- a/samples/simple/CMakeLists.txt
+++ b/samples/simple/CMakeLists.txt
@@ -48,27 +48,8 @@ set(WASM_DIR ${WAMR_ROOT_DIR}/core/iwasm)
set(APP_MGR_DIR ${WAMR_ROOT_DIR}/core/app-mgr)
set(SHARED_DIR ${WAMR_ROOT_DIR}/core/shared-lib)
-set (lv_drivers_name lv_drivers)
-set (lv_name lvgl)
-set (LV_DRIVERS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/${lv_drivers_name})
-set (LVGL_DIR ${WASM_DIR}/lib/3rdparty/${lv_name})
-
-if ((NOT EXISTS ${LVGL_DIR}) OR (NOT EXISTS ${LV_DRIVERS_DIR}))
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl_drivers/CMakeLists.txt)
-
- execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl_drivers )
- if(result)
- message(FATAL_ERROR "CMake step for lvgl drivers failed: ${result}")
- endif()
- execute_process(COMMAND ${CMAKE_COMMAND} --build .
- RESULT_VARIABLE result
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/download_lvgl_drivers )
- if(result)
- message(FATAL_ERROR "Build step for lvgl drivers failed: ${result}")
- endif()
-endif()
+set (LV_DRIVERS_DIR ${WASM_DIR}/lib/3rdparty/lv_drivers)
+set (LVGL_DIR ${WASM_DIR}/lib/3rdparty/lvgl)
file(GLOB_RECURSE LV_DRIVERS_SOURCES "${LV_DRIVERS_DIR}/*.c" )
@@ -93,12 +74,14 @@ include (${SHARED_DIR}/coap/lib_coap.cmake)
include_directories(${SHARED_DIR}/include)
+include_directories(${CMAKE_CURRENT_LIST_DIR}/src)
#Note: uncomment below line to use UART mode
#add_definitions (-DCONNECTION_UART)
add_definitions (-DWASM_ENABLE_BASE_LIB)
add_definitions (-Dattr_container_malloc=bh_malloc)
add_definitions (-Dattr_container_free=bh_free)
+add_definitions (-DLV_CONF_INCLUDE_SIMPLE)
add_library (vmlib
${WASM_PLATFORM_LIB_SOURCE}
diff --git a/samples/simple/CMakeLists.txt.in b/samples/simple/CMakeLists.txt.in
deleted file mode 100644
index c250efc5..00000000
--- a/samples/simple/CMakeLists.txt.in
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2019 Intel Corporation. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cmake_minimum_required(VERSION 2.8.2)
-
-project(lvgl_download NONE)
-
-include(ExternalProject)
-
-ExternalProject_Add(${lv_name}
- GIT_REPOSITORY https://github.com/littlevgl/lvgl.git
- GIT_TAG ""
- BINARY_DIR ""
- SOURCE_DIR "${LVGL_DIR}"
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND ""
- )
-
-ExternalProject_Add(${lv_drivers_name}
- GIT_REPOSITORY https://github.com/littlevgl/lv_drivers.git
- GIT_TAG ""
- BINARY_DIR ""
- SOURCE_DIR "${LV_DRIVERS_DIR}"
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND ""
- )
diff --git a/samples/simple/README.md b/samples/simple/README.md
index 6af377a1..2f8626c1 100644
--- a/samples/simple/README.md
+++ b/samples/simple/README.md
@@ -64,19 +64,37 @@ The `host_init_func` is called when the application manager starts up. And `host
- wasm-apps
+```
https://emscripten.org/docs/tools_reference/emsdk.html
-
+```
Build all binaries
==============
diff --git a/samples/simple/build.sh b/samples/simple/build.sh
index e5590f8d..f803fff0 100755
--- a/samples/simple/build.sh
+++ b/samples/simple/build.sh
@@ -20,6 +20,14 @@ if [ ! -d "tlsf" ]; then
git clone https://github.com/mattconte/tlsf
fi
+cd ${WAMR_DIR}/core/iwasm/lib/3rdparty
+if [ ! -d "lvgl" ]; then
+ git clone https://github.com/littlevgl/lvgl.git --branch v6.0.1
+fi
+if [ ! -d "lv_drivers" ]; then
+ git clone https://github.com/littlevgl/lv_drivers.git
+fi
+
echo "#####################build simple project"
cd ${CURR_DIR}
mkdir -p cmake_build