reworked build config, now works on windows

This commit is contained in:
Sara 2023-11-21 11:01:36 +01:00 committed by Scott-G-GD
parent 9d34f2cbeb
commit e479ecf0ad
3 changed files with 13 additions and 6 deletions

View file

@ -1,12 +1,14 @@
workspace "Fencer-Template" workspace "Fencer-Template"
architecture "x64" architecture "x64"
configurations { "Debug", "Release", "Dist" } configurations { "Debug", "Release", "Dist" }
language "C"
startproject "Game" startproject "Game"
filter "system:windows" filter "system:windows"
defines { "SDL_MAIN_HANDLED" }
buildoptions { "/EHsc", "/Zc:preprocessor" } buildoptions { "/EHsc", "/Zc:preprocessor" }
OutputDir = "%{cfg.system}-%{cfg.architecture}/${cfg.buildcfg}" OutputDir = "%{cfg.system}-%{cfg.architecture}/%{cfg.buildcfg}"
group "Core" group "Core"

View file

@ -6,7 +6,7 @@ project "Engine-Core"
defines { "VMATH_SDL" } defines { "VMATH_SDL" }
files { "src/**.c" } files { "src/**.c", "src/**.h" }
includedirs { "src/" } includedirs { "src/" }
targetdir ( "../bin/" .. OutputDir .. "/%{prj.name}" ) targetdir ( "../bin/" .. OutputDir .. "/%{prj.name}" )

View file

@ -1,12 +1,12 @@
project "Game" project "Game"
kind "ConsoleApp" kind "WindowedApp"
language "C" language "C"
staticruntime "Off" staticruntime "Off"
targetdir "bin/%{cfg.buildcfg}" targetdir "bin/%{cfg.buildcfg}"
defines { "VMATH_SDL" } defines { "VMATH_SDL" }
files { "src/*.c" } files { "src/**.c", "src/**.h" }
includedirs { includedirs {
"src/", "src/",
"../core/src" "../core/src"
@ -15,11 +15,16 @@ project "Game"
"Engine-Core" "Engine-Core"
} }
links { "SDL2", "SDL2_image", "SDL2_ttf", "m", "cjson"}
targetdir ("../bin/" .. OutputDir .. "/%{prj.name}" ) targetdir ("../bin/" .. OutputDir .. "/%{prj.name}" )
objdir ("../intermediate/" .. OutputDir .. "/%{prj.name}" ) objdir ("../intermediate/" .. OutputDir .. "/%{prj.name}" )
filter "system:linux"
links { "SDL2", "SDL2_image", "SDL2_ttf", "m", "cjson"}
filter "system:windows"
linkoptions { "/ENTRY:mainCRTStartup" }
links { "../SDL2.dll", "../SDL2_image.dll" }
filter "configurations:Debug" filter "configurations:Debug"
defines { "DEBUG" } defines { "DEBUG" }
runtime "Debug" runtime "Debug"