diff --git a/README.md b/README.md index c54d2f7..8e9b925 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Notes: * you will need LuaJIT (https://github.com/LuaJIT/LuaJIT.git better 2.1 branch) or precompiled for linux/macOS/windows in https://luapower.com/luajit/download * you can use also a C++ compiler for doing preprocessing: gcc (In windows MinGW-W64-builds for example), clang or cl (MSVC) or not use a compiler (experimental nocompiler option) at all. (this repo was done with gcc) * update `imgui` folder to the version you desire. -* edit `generator/generator.bat` (or make a .sh version and please PR) to choose between gcc, clang, cl or nocompiler. Run it with gcc, clang or cl and LuaJIT on your PATH. +* edit `generator/generator.bat` on windows, or `generator/generator.sh` on linux, to choose between gcc, clang, cl or nocompiler. Run it with gcc, clang or cl and LuaJIT on your PATH. * as a result some files are generated: `cimgui.cpp` and `cimgui.h` for compiling and some lua/json files with information about the binding: `definitions.json` with function info, `structs_and_enums.json` with struct and enum info, `impl_definitions.json` with functions from the implementations info. # generate binding diff --git a/generator/generator.sh b/generator/generator.sh new file mode 100755 index 0000000..d4e05a2 --- /dev/null +++ b/generator/generator.sh @@ -0,0 +1,17 @@ +#!/usr/bin/sh + +# this script must be executed in this directory +# all the output goes to generator/output folder +# .cpp and .h files: +# cimgui.h and cimgui.cpp with gcc preprocess +# cimgui_nopreprocess.h and cimgui_nopreprocess.cpp generated without preprocess +# cimgui_impl.h with implementation function cdefs +# lua and json files: +# definitions.lua for function definitions +# structs_and_enums.lua with struct and enum information-definitions +# impl_definitions.lua for implementation function definitions + +#process files +# arg[1] compiler name gcc, clang, cl or nocompiler +# arg[2..n] name of implementations to generate +luajit ./generator.lua gcc glfw opengl3 opengl2 sdl