55 lines
1.4 KiB
Plaintext
55 lines
1.4 KiB
Plaintext
local m = {}
|
|
|
|
local scriptdir = path.getabsolute(path.getdirectory(_SCRIPT))
|
|
local sfml = require("path/to/build-sfml")
|
|
local imguisfml = require("path/to/build-imgui-sfml")
|
|
|
|
function m.generateproject(bindir, intdir)
|
|
project "example"
|
|
language "C++"
|
|
cppdialect "C++20"
|
|
systemversion "latest"
|
|
kind "WindowedApp"
|
|
targetname "example"
|
|
targetdir (bindir)
|
|
objdir (intdir)
|
|
debug(scriptdir) -- assuming scriptdir has your assets, config files, etc
|
|
|
|
-- link order matters on GCC/Clang
|
|
imguisfml.link()
|
|
sfml.link()
|
|
|
|
-- use path.join() and scriptdir to make
|
|
-- the path relative to the location of the script
|
|
-- otherwise it will be relative to the script that calls
|
|
-- generateproject()
|
|
includedirs
|
|
{
|
|
path.join(scriptdir, "src"),
|
|
path.join(scriptdir, "include"),
|
|
}
|
|
|
|
files
|
|
{
|
|
path.join(scriptdir, "src/**.cpp"),
|
|
path.join(scriptdir, "include/**.h"),
|
|
path.join(scriptdir, "include/**.hpp"),
|
|
}
|
|
|
|
--windows specific settings--
|
|
filter{"system:windows"}
|
|
defines {"PLATFORM_WINDOWS"}
|
|
|
|
filter {"system:windows", "configurations:debug"}
|
|
defines{"_DEBUG", "_CONSOLE"}
|
|
|
|
filter {"system:windows", "configurations:release"}
|
|
defines{"NDEBUG"}
|
|
|
|
--linux specific settings--
|
|
filter {"system:linux"}
|
|
defines {"PLATFORM_LINUX"}
|
|
|
|
end
|
|
|
|
return m |