SFML, Dear ImGui, and their dependencies all bundled together with premake build scripts.
Go to file
Joseph Aquino f39abf24dd update build scripts 2025-12-30 23:15:51 -05:00
SFML@0fa201c969 checkout submodules to correct versions 2025-12-30 18:34:46 -05:00
flac@28e4f0528c checkout submodules to correct versions 2025-12-30 18:34:46 -05:00
freetype@920c5502cc checkout submodules to correct versions 2025-12-30 18:34:46 -05:00
imgui@97428e8ac9 checkout submodules to correct versions 2025-12-30 18:34:46 -05:00
imgui-sfml@5e8f8fb857 checkout submodules to correct versions 2025-12-30 18:34:46 -05:00
ogg@e1774cd77f checkout submodules to correct versions 2025-12-30 18:34:46 -05:00
premake-scripts update build scripts 2025-12-30 23:15:51 -05:00
premake5 update bundled premake 2025-12-30 18:30:12 -05:00
vorbis@0657aee69d checkout submodules to correct versions 2025-12-30 18:34:46 -05:00
.gitignore Edit .gitignore 2025-12-30 23:37:05 +00:00
.gitmodules update bundled premake 2025-12-30 18:30:12 -05:00
LICENSE Add new file 2025-12-30 23:37:51 +00:00
README.md update examples and readme 2025-12-30 21:58:25 -05:00
example-project.txt update examples and readme 2025-12-30 21:58:25 -05:00
example-workspace.txt update examples and readme 2025-12-30 21:58:25 -05:00

README.md

Easily add SFML 3 and Dear ImGui to your premake5 projects


This repo contains the repositories for SFML, Dear ImGui, sfml-imgui, flac, vorbis, ogg, and freetype along with premake build scripts. This allows your project to build these libraries from source and statically link them to your executible. this makes developing on linux easier as most distros don't have SFML 3 in their package managers.

I have included example-project.txt and example-workspace.txt as examples on how to use this project

How to integrate into your projects

  1. Add the repository as a submodule and update its submodules
    -(optional) replace <directory-path> with the path to the directory you want the repo to be cloned to, leaving this out will place this repo into ./imgui-sfml-premake
git submodule add https://gitlab.com/JosephA1997/imgui-sfml-premake.git <directory-path><br>
git submodule update --init --recursive
  1. Add this to the top of the script that contains the workspace, replace 'path/to' with the directory that you cloned this repo to
local ogg = require("path/to/premake-scripts/build-ogg")
local imgui = require("path/to/premake-scripts/build-imgui")
local sfml = require("path/to/premake-scripts/sfml/build-sfml")
local flac = require("path/to/premake-scripts/flac/build-flac")
local vorbis = require("path/to/premake-scripts/vorbis/build-vorbis")
local freetype = require("path/to/premake-scripts/freetype/build-freetype")
local imguisfml = require("path/to/premake-scripts/imgui-sfml/build-imgui-sfml")
  1. In the workspace, add these lines
filter"system:linux"
    pic"On" -- fix warning when statically linking <relocation against ... in read-only section .text>
filter""

externalwarnings "Off" --turn off build warnings created from sfml, imgui, and it's depedencies
  1. In the workspace, add these lines to add each dependency as its own project
    <target-directory> - the directory where the static library will be placed
    <obj-directory> - the directory where object files will be placed
ogg.generateproject(<target-directory>, <obj-directory>)
sfml.generateproject(<target-directory>, <obj-directory>)
flac.generateproject(<target-directory>, <obj-directory>)
imgui.generateproject(<target-directory>, <obj-directory>)
vorbis.generateproject(<target-directory>, <obj-directory>)
freetype.generateproject(<target-directory>, <obj-directory>)
imguisfml.generateproject(<target-directory>, <obj-directory>)
  1. At the top of each lua file containing a project that needs imgui or sfml, add these lines, replace 'path/to' with the directory that you cloned this repo to. if the project is in the same file as the workspace you can skip this
local sfml = require("path/to/premake-scripts/build-sfml")
local imgui = require("path/to/premake-scripts/build-imgui")
local imguisfml = require("path/to/premake-scripts/build-imgui-sfml")
  1. Inside of the projects that need sfml or imgui add these lines
-- link order matters on GCC/Clang
imgui.link()
imguisfml.link()
sfml.link()

Bundled Premake Info

I have included premake5 executibles for windows and linux in the premake5 directory. Inside you'll also find modules that add support for the ninja build system and to generate a compile_commands.json file for things like clangd

To use premake on windows

.\path\to\premake5\premake5.exe

And on linux

./path/to/premake5/premake5

To generate ninja build files, use the premake-ninja action

premake5 premake-ninja

To generate compile_commands.json, use the ecc action

premake5 ecc

Credits:
  • SFML (zlib/png license) Copyright (C) Laurent Gomila

  • Dear ImGui (MIT License) Copyright (c) 2014-2025 Omar Cornut

  • imgui-sfml (MIT License)
    Copyright (c) 2016 Elias Daler
    Copyright (c) 2014-2016 Omar Cornut and ImGui contributors
    Copyright (c) 2014 Mischa Aster Alff

  • FreeType (The FreeType Project License) Portions of this software are copyright © 2025 The FreeType Project (www.freetype.org). All rights reserved.

  • Ogg, Vorbis, FLAC (BSD-3-Clause) Copyright (c) Xiph.Org Foundation