Skip to content

Commit

Permalink
update: bsp/mini在win/linux环境下,32bit和64bit均编译和运行正常
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Sep 25, 2023
1 parent 52f92a5 commit 762737a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
3 changes: 0 additions & 3 deletions bsp/mini/build_linux.sh

This file was deleted.

7 changes: 7 additions & 0 deletions bsp/mini/build_linux_32bit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# ubuntu下所需要安装的软件
# apt install gcc-multilib apt install g++-multilib

xmake clean -a
xmake f -p linux -a i386
xmake -w
3 changes: 3 additions & 0 deletions bsp/mini/build_linux_64bit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
xmake clean -a
xmake f -p linux -a x86_64
xmake -w
File renamed without changes.
4 changes: 4 additions & 0 deletions bsp/mini/build_windows_64bit.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

xmake clean -a
xmake f -p mingw --sdk=C:\msys64\mingw32 -a x86_64
xmake
3 changes: 2 additions & 1 deletion bsp/mini/src/main_mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "luat_malloc.h"
#include "luat_msgbus.h"
#include "luat_fs.h"
#include <stdlib.h>

#include "bget.h"

Expand All @@ -23,7 +24,7 @@ void luat_log_init_win32(void);
void luat_uart_initial_win32(void);

static void _luat_main(void* args) {
//luat_main();
(void)args;
luat_fs_init();
lua_main(cmdline_argc, cmdline_argv);
exit(0);
Expand Down
2 changes: 1 addition & 1 deletion bsp/mini/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set_languages("c11", "cxx11")
add_defines("__LUATOS__", "__XMAKE_BUILD__")
add_defines("MBEDTLS_CONFIG_FILE=\"mbedtls_config_mini.h\"")

add_ldflags("-Wl,-gc-sections")
--add_ldflags("-Wl,-gc-sections")

if is_host("windows") then
add_defines("LUA_USE_WINDOWS")
Expand Down

0 comments on commit 762737a

Please sign in to comment.