changed examples to txt files
This commit is contained in:
parent
37ae554f9f
commit
fd7b4eb060
|
|
@ -0,0 +1,55 @@
|
||||||
|
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
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
local ogg = require("path/to/ogg/build-ogg")
|
||||||
|
local sfml = require("path/to/sfml/build-sfml")
|
||||||
|
local flac = require("path/to/flac/build-flac")
|
||||||
|
local vorbis = require("path/to/vorbis/build-vorbis")
|
||||||
|
local freetype = require("path/to/freetype/build-freetype")
|
||||||
|
local imguisfml = require("path/to/imgui-sfml/build-imgui-sfml")
|
||||||
|
|
||||||
|
local exampleproject = require("path/to/project")
|
||||||
|
|
||||||
|
-- assuming you are using the modules i provided with premake
|
||||||
|
require ("ecc/ecc")
|
||||||
|
require ("ninja/ninja")
|
||||||
|
|
||||||
|
workspace "Example"
|
||||||
|
architecture "x64"
|
||||||
|
startproject "Example"
|
||||||
|
staticruntime "Off"
|
||||||
|
|
||||||
|
-- assuming you want your build files in seperate directory
|
||||||
|
location "build"
|
||||||
|
|
||||||
|
configuration {"Debug", "Release"}
|
||||||
|
|
||||||
|
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 and it's depedencies
|
||||||
|
|
||||||
|
filter "configurations:debug"
|
||||||
|
symbols "on"
|
||||||
|
runtime "Debug"
|
||||||
|
warnings "Extra"
|
||||||
|
|
||||||
|
filter "configurations:release"
|
||||||
|
optimize "Speed"
|
||||||
|
inlining "Auto"
|
||||||
|
symbols "off"
|
||||||
|
runtime "Release"
|
||||||
|
filter""
|
||||||
|
|
||||||
|
output_dir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
|
||||||
|
intdir = "intermediate-files/"
|
||||||
|
bindir = "bin/" .. output_dir
|
||||||
|
liboutdir = "lib/" .. output_dir
|
||||||
|
|
||||||
|
group"Dependencies"
|
||||||
|
ogg.generateproject(liboutdir, intdir)
|
||||||
|
sfml.generateproject(liboutdir, intdir)
|
||||||
|
flac.generateproject(liboutdir, intdir)
|
||||||
|
vorbis.generateproject(liboutdir, intdir)
|
||||||
|
freetype.generateproject(liboutdir, intdir)
|
||||||
|
imguisfml.generateproject(liboutdir, intdir)
|
||||||
|
group""
|
||||||
|
|
||||||
|
exampleproject.generateproject(bindir, intdir)
|
||||||
|
|
||||||
|
-- add your other projects
|
||||||
Loading…
Reference in New Issue