Fix windows build (no WASI)

extensions
Volodymyr Shymanskyy 5 years ago
parent 278491e3bb
commit 231d6915df

@ -25,3 +25,27 @@ jobs:
run: |
cd test
./run-spec-test.py
build-win:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
toolset: [ClangCL, v142]
steps:
- uses: actions/checkout@v1
- name: configure
run: |
mkdir build
cd build
cmake -T ${{ matrix.toolset }} ..
- name: make
run: |
cmake --build build --config Release
cp ./build/Release/wasm3.exe ./build/
- name: test
run: |
cd test
python run-spec-test.py

@ -90,6 +90,7 @@ elseif(WIN32)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oxs /Oy /GS- /Qvec -Clang -O3")
endif()
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Dd_m3HasWASI")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wstrict-aliasing -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -O0")

@ -182,8 +182,8 @@ int main (int i_argc, const char* i_argv[])
while (argRepl)
{
char cmd_buff[128] = {};
const char* argv[32] = {};
char cmd_buff[128] = { 0, };
const char* argv[32] = { 0, };
fprintf(stdout, "wasm3> ");
fflush(stdout);
if (!fgets(cmd_buff, sizeof(cmd_buff), stdin)) {

@ -13,11 +13,27 @@
#include "m3_exception.h"
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#if defined(WIN32)
#include <Windows.h>
int clock_gettime(int clk_id, struct timespec *spec)
{
__int64 wintime;
GetSystemTimeAsFileTime((FILETIME*)&wintime);
wintime -=116444736000000000i64; //1jan1601 to 1jan1970
spec->tv_sec =wintime / 10000000i64; //seconds
spec->tv_nsec =wintime % 10000000i64 *100; //nano-seconds
return 0;
}
#endif
// TODO: return trap
void m3_libc_abort()
{

@ -12,6 +12,8 @@
#include "m3_module.h"
#include "m3_exception.h"
#if defined(d_m3HasWASI)
#include "extra/wasi_core.h"
#include <sys/types.h>
@ -377,7 +379,6 @@ M3Result SuppressLookupFailure(M3Result i_result)
return i_result;
}
M3Result m3_LinkWASI (IM3Module module)
{
M3Result result = c_m3Err_none;
@ -410,4 +411,12 @@ _catch:
return result;
}
#else // d_m3HasWASI
M3Result m3_LinkWASI (IM3Module module)
{
return c_m3Err_none;
}
#endif // d_m3HasWASI

@ -187,6 +187,7 @@ IM3Function Module_GetFunction (IM3Module i_module, u32
//---------------------------------------------------------------------------------------------------------------------------------
typedef struct M3Environment
{
int dummmy;
// u32 numFuncTypes;
// M3FuncType * funcTypes;
}

Loading…
Cancel
Save