Build: Add usepch option to use precompiled headers

This commit is contained in:
Jérôme Leclercq
2022-03-09 20:06:38 +01:00
parent 4a8ebf869b
commit 3e556a72b6
9 changed files with 40 additions and 10 deletions

View File

@@ -109,6 +109,12 @@ NazaraModules = modules
includes("xmake/**.lua")
option("usepch")
set_default(false)
set_showmenu(true)
set_description("Use precompiled headers to speedup compilation")
option_end()
set_project("NazaraEngine")
set_xmakever("2.6.3")
@@ -185,6 +191,10 @@ for name, module in pairs(modules) do
add_rules("embed_resources")
add_rpathdirs("$ORIGIN")
if has_config("usepch") then
set_pcxxheader("include/Nazara/" .. name .. ".hpp")
end
if module.Deps then
add_deps(table.unpack(module.Deps))
end