GraphC/README.md
2024-07-30 00:54:03 +03:00

41 lines
1.7 KiB
Markdown

# GraphC - visual programming tool
When i was working on my compiler project, i understood that AST processing code isn't clear even for me because of hundreds lines of condition branches. GraphC is GUI editor of condition trees. It generates optimized AST processing code in C.
GUI is based on [Dear ImGui](https://github.com/ocornut/imgui) and [SDL](https://github.com/libsdl-org/sdlwiki)
## Installation
1. Clone the repository
```sh
git clone --recurse-submodules https://timerix.ddns.net:3322/Timerix/GraphC.git
```
2. Install [cbuild](https://timerix.ddns.net:3322/Timerix/cbuild.git)
3. Install **SDL2** from package manager or compile it from source.
**If you are using msys, switch to mingw64 sh.**
```sh
git clone https://github.com/libsdl-org/SDL.git
cd SDL
./configure
make -j [number of cpu threads]
```
Then you can install it systemwide (on **Linux**):
```sh
sudo make install
```
or copy to ./dependencies/precompiled/ (on **Windows**):
```sh
mkdir -p ../GraphC/dependencies/precompiled/
cp ./build/.libs/SDL2.dll ../GraphC/dependencies/precompiled/
```
If it doesn't work, read [SDL/INSTALL.txt](https://github.com/libsdl-org/SDL/blob/SDL2/INSTALL.txt) and [SDL/docs/README.md](https://github.com/libsdl-org/SDL/blob/SDL2/docs/README.md).
4. Symlink SDL headers directory to `dependencies/include`
```sh
cd ../GraphC
ln -s SDL2_HEADERS_DIRECTORY_ABSOLUTE_PATH -T dependencies/include/SDL2
```
Location of the headers can be found by `pkg-config --cflags --libs sdl2`.
Mingw installs SDL2 headers to `/mingw64/include/SDL2`.
5. Compile the program
```sh
cbuild build_exec_dbg
```