diff --git a/.gitignore b/.gitignore index c81b3bc..4b7ae57 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ game .gdb_history compile_commands.json .cache/ +build +compile_commands +Makefile diff --git a/SConstruct b/SConstruct deleted file mode 100644 index 8147c58..0000000 --- a/SConstruct +++ /dev/null @@ -1,26 +0,0 @@ -from pathlib import Path -import os - -project='game' - -def glob_recurse(dir): - sources = Glob(os.path.join(dir, '*.cpp')) - for path in dir.iterdir(): - if path.is_dir(): - sources.extend(glob_recurse(path)) - return sources - -sources = glob_recurse(Path('src/')) - -env = Environment(CCFLAGS=[ - '--std=c++23', - '-fno-exceptions', - '-Wall', '-Wpedantic', '-Wextra', '-Werror', - '-O0', '-g3', '-Isrc', - '-DPROJECTNAME=\\\"'+project+'\\\"', - '-DDEBUG' -], -LINKFLAGS=[ - '-lSDL2', '-lSDL2_image', '-lm', -]) -env.Program(project, sources) diff --git a/premake5.lua b/premake5.lua new file mode 100644 index 0000000..d596d05 --- /dev/null +++ b/premake5.lua @@ -0,0 +1,23 @@ +workspace "game" + configurations { "debug", "release" } + location "." + +project "game" + kind "WindowedApp" + language "c++" + cppdialect "c++20" + location "build/" + files { "src/**.cpp" } + includedirs { "src/" } + links { "SDL2", "SDL2_image", "m" } + targetdir "bin/" + exceptionhandling "Off" + filter "configurations:debug" + defines { "DEBUG" } + optimize "Off" + symbols "On" + filter "configurations:release" + defines { "NDEBUG" } + optimize "On" + symbols "Off" + postbuildcommands "{COPYDIR} ../resources %{cfg.targetdir}"