feat: switched build system to premake (replacing SCons)

main
Sara 2025-01-05 16:59:32 +01:00
parent b486f09939
commit 48b094c979
3 changed files with 26 additions and 26 deletions

3
.gitignore vendored
View File

@ -5,3 +5,6 @@ game
.gdb_history .gdb_history
compile_commands.json compile_commands.json
.cache/ .cache/
build
compile_commands
Makefile

View File

@ -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)

23
premake5.lua Normal file
View File

@ -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}"