mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 16:58:34 +00:00
Update CMake to import Lua library
This commit is contained in:
parent
9ab723135a
commit
3d746b956d
|
@ -60,8 +60,9 @@ set(WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
|
||||||
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
|
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
|
||||||
|
|
||||||
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
|
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
|
||||||
################################################
|
|
||||||
|
|
||||||
|
################ Lua application #################
|
||||||
|
find_package(Lua REQUIRED)
|
||||||
|
|
||||||
################ wasm application ################
|
################ wasm application ################
|
||||||
add_subdirectory(wasm-apps)
|
add_subdirectory(wasm-apps)
|
||||||
|
@ -72,9 +73,9 @@ include_directories(include)
|
||||||
|
|
||||||
set (RUNTIME_SOURCE_ALL
|
set (RUNTIME_SOURCE_ALL
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/main.c
|
${CMAKE_CURRENT_LIST_DIR}/src/main.c
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/lua.c
|
${CMAKE_CURRENT_LIST_DIR}/src/luaModule.c
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/wasm.c
|
${CMAKE_CURRENT_LIST_DIR}/src/wasm.c
|
||||||
${UNCOMMON_SHARED_SOURCE}
|
${UNCOMMON_SHARED_SOURCE}
|
||||||
)
|
)
|
||||||
add_executable (comparison ${RUNTIME_SOURCE_ALL})
|
add_executable (comparison ${RUNTIME_SOURCE_ALL})
|
||||||
target_link_libraries(comparison vmlib -lpthread -lm)
|
target_link_libraries(comparison vmlib -lpthread -lm ${LUA_LIBRARIES})
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,11 @@
|
||||||
#include "lua.h"
|
|
||||||
//#include "/usr/local/include/lauxlib.h"
|
|
||||||
//#include "/usr/local/include/lualib.h"
|
#include <stdio.h>
|
||||||
#include "/usr/local/include/lua.hpp"
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <lua.h>
|
||||||
|
#include <lualib.h>
|
||||||
|
#include <lauxlib.h>
|
||||||
|
|
||||||
#define THREAD_NUM 10
|
#define THREAD_NUM 10
|
||||||
|
|
|
@ -3,14 +3,20 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "wasm_export.h"
|
#include "wasm_export.h"
|
||||||
#include "bh_read_file.h"
|
#include "bh_read_file.h"
|
||||||
#include "pthread.h"
|
#include "pthread.h"
|
||||||
|
|
||||||
|
// Include Lua Library
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
|
#include <lualib.h>
|
||||||
|
#include <lauxlib.h>
|
||||||
|
|
||||||
|
#include "luaModule.h"
|
||||||
#include "wasm.h"
|
#include "wasm.h"
|
||||||
//#include "/usr/local/include/lauxlib.h"
|
|
||||||
//#include "/usr/local/include/lualib.h"
|
|
||||||
#include "/usr/local/include/lua.hpp"
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user