【譯】【Game Engine】007. Premake

premake5.lua 排雷總結(jié)版本
對(duì)原來的postbuildcommands和defines進(jìn)行了修正
以下是代碼:
workspace "Hazel"?
architecture "x86_64"
startproject "Sandbox"
configurations
{
"Debug",
"Release",
"Dist"
}
outputdir="%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
project "Hazel"
location "Hazel"
kind "SharedLib"
language "C++"
targetdir("bin/" .. outputdir .. "/%{prj.name}")
objdir("bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp"
}
includedirs
{
"%{prj.name}/src/Hazel/vendor/spdlog/include",
"%{prj.name}/vendor/spdlog/include",
"%{prj.name}/src"?
}
filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"
defines
{
"HZ_PLATFORM_WINDOWS",
"HZ_BUILD_DLL",
"_WINDLL"
}
postbuildcommands
{
("{COPY} %{cfg.buildtarget.relpath} \"../bin/" .. outputdir .. "/Sandbox/\"")
}
filter "configurations:Debug"
defines "HZ_DEBUG"
symbols "On"
filter "configurations:Release"
defines "HZ_RELEASE"
optimize "On"
filter "configurations:Dist"
defines "HZ_DIST"
optimize "On"
project "Sandbox"
location "Sandbox"
kind "ConsoleApp"
language "C++"
targetdir("bin/" .. outputdir .. "/%{prj.name}")
objdir("bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp",
"%{prj.name}/src/**.hpp"
}
includedirs
{
"Hazel/src/Hazel/vendor/spdlog/include",
"Hazel/vendor/spdlog/include",
"Hazel/src"?
}
links
{
"Hazel"
}
filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"
defines
{
"HZ_PLATFORM_WINDOWS",
}
filter "configurations:Debug"
defines "HZ_DEBUG"
symbols "On"
filter "configurations:Release"
defines "HZ_RELEASE"
optimize "On"
filter "configurations:Dist"
defines "HZ_DIST"
optimize "On"