Commit aef1076a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parents
CC := emcc -s WASM=1
SO := wasm
all : libk_so.$(SO)
libk_so.$(SO) :
$(CC) -s SIDE_MODULE=1 -DLIBK_COMPILE -o $@ libk.c
#ifndef _DSO_H
#define _DSO_H
// DSO_EXPORT marks a symbol as exported from currently-compiled DSO.
// XXX + attr(used) ? (emscripten does this)
#define DSO_EXPORT __attribute__((visibility("default")))
// XXX stub (__declspec(dllimport) on mingw)
#define DSO_IMPORT
#endif
#include "libk.h"
LIBKAPI
int kfunc1() {
return 12;
}
#ifndef _LIBK_H
#define _LIBK_H
#include "dso.h"
#ifdef LIBK_COMPILE
# define LIBKAPI DSO_EXPORT
#else
# define LIBKAPI DSO_IMPORT
#endif
LIBKAPI int kfunc1();
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment