44 lines
1.6 KiB
Markdown
44 lines
1.6 KiB
Markdown
# How to Build
|
|
|
|
## Windows with Visual Studio's IDE
|
|
|
|
Use the provided project file (`example_sdl3_surface.vcxproj`) or open `imgui_examples.sln`.
|
|
|
|
## Windows with Visual Studio's CLI
|
|
|
|
Use `build_win32.bat` or directly:
|
|
```bat
|
|
set SDL3_DIR=path_to_your_sdl3_folder
|
|
cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL3_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_sdlsurface3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_surface.exe /FoDebug/ /link /libpath:%SDL3_DIR%\lib\x86 SDL3.lib /subsystem:console
|
|
cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL3_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_sdlsurface3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_surface.exe /FoDebug/ /link /libpath:%SDL3_DIR%\lib\x64 SDL3.lib /subsystem:console
|
|
```
|
|
|
|
## Linux and similar Unixes
|
|
|
|
Use the provided `Makefile` or directly:
|
|
```sh
|
|
c++ `pkg-config --cflags sdl3` -I .. -I ../.. -I ../../backends \
|
|
main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_sdlsurface3.cpp ../../imgui*.cpp \
|
|
-ldl `pkg-config --libs sdl3`
|
|
```
|
|
|
|
## macOS
|
|
|
|
Use the provided `Makefile` or directly:
|
|
```sh
|
|
brew install sdl3
|
|
c++ `pkg-config --cflags sdl3` -I .. -I ../.. -I ../../backends \
|
|
main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_sdlsurface3.cpp ../../imgui*.cpp \
|
|
-framework Cocoa -framework IOKit -framework CoreVideo `pkg-config --libs sdl3`
|
|
```
|
|
|
|
## Emscripten
|
|
|
|
Use `Makefile.emscripten`:
|
|
```sh
|
|
source /path/to/emsdk/emsdk_env.sh
|
|
make -f Makefile.emscripten
|
|
```
|
|
|
|
This produces `web/index.html`, `web/index.js`, and `web/index.wasm`.
|