diff --git a/Build.lua b/Build.lua index 3402f02..a2777cf 100644 --- a/Build.lua +++ b/Build.lua @@ -1,12 +1,14 @@ workspace "Fencer-Template" architecture "x64" configurations { "Debug", "Release", "Dist" } + language "C" startproject "Game" filter "system:windows" + defines { "SDL_MAIN_HANDLED" } buildoptions { "/EHsc", "/Zc:preprocessor" } - OutputDir = "%{cfg.system}-%{cfg.architecture}/${cfg.buildcfg}" + OutputDir = "%{cfg.system}-%{cfg.architecture}/%{cfg.buildcfg}" group "Core" diff --git a/core/Build-Core.lua b/core/Build-Core.lua index c4dbd8a..8bdb34e 100644 --- a/core/Build-Core.lua +++ b/core/Build-Core.lua @@ -6,7 +6,7 @@ project "Engine-Core" defines { "VMATH_SDL" } - files { "src/**.c" } + files { "src/**.c", "src/**.h" } includedirs { "src/" } targetdir ( "../bin/" .. OutputDir .. "/%{prj.name}" ) diff --git a/game/Build-Game.lua b/game/Build-Game.lua index 82d3bd6..fd6bf22 100644 --- a/game/Build-Game.lua +++ b/game/Build-Game.lua @@ -1,12 +1,12 @@ project "Game" - kind "ConsoleApp" + kind "WindowedApp" language "C" staticruntime "Off" targetdir "bin/%{cfg.buildcfg}" defines { "VMATH_SDL" } - files { "src/*.c" } + files { "src/**.c", "src/**.h" } includedirs { "src/", "../core/src" @@ -15,11 +15,16 @@ project "Game" "Engine-Core" } - links { "SDL2", "SDL2_image", "SDL2_ttf", "m", "cjson"} - targetdir ("../bin/" .. 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" defines { "DEBUG" } runtime "Debug"