This guide gives an overview on how to build lvgljs running with SDL simulator. This should work the same for both Linux and macOS.
You'll need to install these dependencies:
Mac | Linux |
---|---|
brew install cmake sdl2 node |
sudo apt install cmake nodejs libsdl2-dev |
Then run make setup
. This will initialize the git submodules and install the necessary npm packages
The demos are located at /demos/*
.
make demo
will build the simulator and run the widgets
demo. Optionally you can add PROJECT=<demoName>
where demoName
is the directory in /demos
, if you want to run a specific project e.g. make demo PROJECT=calculator
- Build the simulator with
make simulator
, which will then be available in thebuild/
directory. - Run
npm run bundle
to generate*.js
files from the*.jsx
files in thetest/
anddemo/
directories. You can also run this in watch mode to automatically build the files, vianpm run bundle:watch
. - Run the simulator with the path to the generated file. You can also run this in watch mode to automatically restart the simulator upon file changes e.g.:
npm run sim:watch -- test/button/2/index.js
Putting these together, once you've built the simulator (via make simulator
) you can then set open two terminals.
Terminal Window 1 | Terminal Window 2 |
---|---|
npm run bundle:watch |
npm run sim:watch <pathToGeneratedJsFile> |