Working on getting a project building with emscripten using this repo as a starting point, however I'm getting a build error on this repo. I'm running on Ubuntu 21.04 and already have libsdl2 and libsdl2-dev installed from the package manager.
Then, from the readme, it suggests you can run make or emconfigure cmake -DCMAKE_TOOLCHAIN_FILE="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" -S . -B build && cmake --build build -j $(nproc)
make fails because there is no top-level makefile. The second command gives an error:
error: use `emcmake` rather then `emconfigure` for cmake projects
lv_obj.c:304:12: error: use of undeclared identifier 'LV_BASE_DIR_AUTO'; did you mean 'LV_BIDI_DIR_AUTO'?
return LV_BIDI_BASE_DIR_DEF;
^~~~~~~~~~~~~~~~~~~~
LV_BIDI_DIR_AUTO
lv_conf.h:364:30: note: expanded from macro 'LV_BIDI_BASE_DIR_DEF'
#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
^
lv_bidi.h:36:5: note: 'LV_BIDI_DIR_AUTO' declared here
LV_BIDI_DIR_AUTO = 0x02,
^
1 error generated.
Editing the lv_conf.h file to alias this definition again #define LV_BASE_DIR_AUTO LV_BIDI_DIR_AUTO gets further along, but eventually fails with:
lv_sim_emscripten/lvgl/src/extra/widgets/span/lv_span.c:92:62: error: too many arguments to function call, expected 2, have 3
return lv_obj_class_create_obj(&lv_spangroup_class, par, NULL);
~~~~~~~~~~~~~~~~~~~~~~~ ^~~~
emsdk/upstream/emscripten/cache/sysroot/include/string.h:13:14: note: expanded from macro 'NULL'
#define NULL ((void*)0)
^~~~~~~~~~
lv_sim_emscripten/lvgl/src/extra/widgets/span/../../../../src/core/lv_obj_class.h:75:20: note: 'lv_obj_class_create_obj' declared here
struct _lv_obj_t * lv_obj_class_create_obj(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * parent);
^
1 error generated.
Which leads me to believe there is something going wrong not on my end since these definitions don't line up. It's also possible I'm running the wrong commands since the README seems to be a little out of date. For example, the instructions for cloning the lv_sim_emscripten repo point to a different name but I haven't looked too much into that.
Working on getting a project building with
emscripten
using this repo as a starting point, however I'm getting a build error on this repo. I'm running on Ubuntu 21.04 and already havelibsdl2
andlibsdl2-dev
installed from the package manager.Steps:
Then, from the readme, it suggests you can run
make
oremconfigure cmake -DCMAKE_TOOLCHAIN_FILE="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" -S . -B build && cmake --build build -j $(nproc)
make
fails because there is no top-level makefile. The second command gives an error:So, adjusting the command to:
starts a build, however it fails with:
Editing the
lv_conf.h
file to alias this definition again#define LV_BASE_DIR_AUTO LV_BIDI_DIR_AUTO
gets further along, but eventually fails with:Which leads me to believe there is something going wrong not on my end since these definitions don't line up. It's also possible I'm running the wrong commands since the README seems to be a little out of date. For example, the instructions for cloning the
lv_sim_emscripten
repo point to a different name but I haven't looked too much into that.