Skip to content

Commit

Permalink
added support for premake5
Browse files Browse the repository at this point in the history
  • Loading branch information
ignite720 committed Jun 17, 2023
1 parent 712a462 commit 808c14b
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 0 deletions.
74 changes: 74 additions & 0 deletions VEngine/premake5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
project("VEngine")
location(g_wkslight.workspacedir .. "/%{prj.name}")
targetdir(g_wkslight.targetdir)
debugdir("")
debugargs({ "" })
kind("ConsoleApp")
language("C++")
pchheader("vpch.h")
pchsource("Code/vpch.cpp")
files({
"Code/**.h",
"Code/**.cpp",
"Code/**.hlsl",
})
removefiles({
"Code/Editor/imgui/backends/**.*",
"Code/Editor/imgui/examples/**.*",
"Code/Editor/imgui/misc/**.*",
"Code/Editor/ImGuizmo/example/**.*",
"Code/Editor/ImGuizmo/vcpkg-example/**.*",
})
files({
"Code/Editor/imgui/backends/imgui_impl_dx11.cpp",
"Code/Editor/imgui/backends/imgui_impl_win32.cpp",
})
includedirs({
"Code",
"Code/Editor/imgui",
"Code/Editor/ImGuizmo",
})
links({
"d3d11.lib",
"dxgi.lib",
"d3dcompiler.lib",
"d2d1.lib",
"dwrite.lib",
})
defines({
--"_USE_MATH_DEFINES",
})
filter("files:Code/Editor/imgui/**.cpp")
flags({ "NoPCH" })
filter("files:Code/Editor/ImGuizmo/**.cpp")
flags({ "NoPCH" })
filter("files:Code/SHMath/**.cpp")
flags({ "NoPCH" })
filter("files:Code/**.hlsl")
flags({ "ExcludeFromBuild" })
shadermodel("5.0")
shaderobjectfileoutput("%{wks.location}/../%{prj.name}/Shaders/%{file.basename}.cso")
filter("files:Code/Render/Shaders/Vertex/*.hlsl")
removeflags({ "ExcludeFromBuild" })
shadertype("Vertex")
shaderobjectfileoutput("%{wks.location}/../%{prj.name}/Shaders/Vertex/%{file.basename}.cso")
filter("files:Code/Render/Shaders/Pixel/*.hlsl")
removeflags({ "ExcludeFromBuild" })
shadertype("Pixel")
shaderobjectfileoutput("%{wks.location}/../%{prj.name}/Shaders/Pixel/%{file.basename}.cso")
filter("files:Code/Render/Shaders/Compute/*CS.hlsl")
removeflags({ "ExcludeFromBuild" })
shadertype("Compute")
shaderentry("CSFunc")
--shaderoptions({ "/E 'CSFunc'" })
filter("action:vs*")
debugenvs({
"$(LocalDebuggerEnvironment)",
"QT_QPA_PLATFORM_PLUGIN_PATH=" .. g_wkslight.extras.qt_root .. "\\plugins\\platforms",
})
vspropertysheet({
"D:\\dev2\\DirectXTK.props",
"D:\\dev2\\fbxsdk.props",
"D:\\dev2\\PhysX-4.1.props",
"D:\\dev2\\qt5.props",
})
3 changes: 3 additions & 0 deletions premake5-clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
@call "premake5.exe" clean
@ping -n 2 127.0.0.1>nul
3 changes: 3 additions & 0 deletions premake5-generate-gmake.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
@call "premake5.exe" gmake
@ping -n 2 127.0.0.1>nul
3 changes: 3 additions & 0 deletions premake5-generate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
@call "premake5.exe" vs2022
@ping -n 2 127.0.0.1>nul
18 changes: 18 additions & 0 deletions premake5-wkslight.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
g_wkslight = require("premake5-modules.premake-wkslight.wkslight")
g_wkslight.workspace = {
name = "VEngine-wks",
startproject = "",
platforms = { "x64" },
cppdialect = "C++20",
thirdparty = {
name = "thirdparty",
projects = {
},
},
projects = {
"VEngine",
},
}
g_wkslight.extras = {
qt_root = "D:\\dev2\\qt-5.15.2",
}
44 changes: 44 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
require("premake5-modules.premake-vspropertysheet.vspropertysheet")
require("premake5-wkslight")
workspace(g_wkslight.workspace.name)
location(path.getbasename(g_wkslight.workspacedir))
platforms(g_wkslight.workspace.platforms)
configurations({ "Debug", "Release" })
characterset("Default")
cppdialect(g_wkslight.workspace.cppdialect)
floatingpoint("Default")
rtti("Default")
exceptionhandling("Default")
filter("system:windows")
systemversion("latest")
filter("system:linux")
pic("On")
filter("action:vs*")
startproject(g_wkslight.workspace.startproject)
staticruntime("Off")
characterset("MBCS")
flags({ "MultiProcessorCompile" })
defines({
"_CRT_SECURE_NO_WARNINGS",
"_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS",
"_HAS_STD_BYTE=0",
})
--buildoptions({ "/utf-8", "/Zc:char8_t-" })
filter("action:gmake*")
buildoptions({ "-static" })
filter("configurations:Debug")
defines({ "_DEBUG" })
symbols("On")
optimize("Off")
filter("configurations:Release")
defines({ "NDEBUG" })
symbols("Off")
optimize("Speed")
group(g_wkslight.workspace.thirdparty.name)
for k, v in pairs(g_wkslight.workspace.thirdparty.projects) do
include(v.location)
end
group("")
for i, v in ipairs(g_wkslight.workspace.projects) do
include(v)
end

0 comments on commit 808c14b

Please sign in to comment.