Add Build Customizations option

Support Build Customization settings for projects. Now Premake5 can
recognize Build Customizations File that 3rd party API (e.g. CUDA)
maded.
This commit is contained in:
pohan 2016-02-23 11:54:20 +08:00
parent 13d0008a3f
commit 2eacbe8623
2 changed files with 20 additions and 0 deletions

View File

@ -77,6 +77,12 @@
pathVars = true,
}
api.register {
name = "buildcustomizations",
scope = "project",
kind = "list:string",
}
api.register {
name = "builddependencies",
scope = { "rule" },

View File

@ -1313,6 +1313,7 @@
m.elements.importExtensionTargets = function(prj)
return {
m.importRuleTargets,
m.importBuildCustomizationsTargets
}
end
@ -1330,6 +1331,12 @@
end
end
function m.importBuildCustomizationsTargets(prj)
for i, build in ipairs(prj.buildcustomizations) do
premake.w('<Import Project="$(VCTargetsPath)\\BuildCustomizations\\%s.targets" />', path.translate(build))
end
end
function m.importDefaultProps(prj)
@ -1345,6 +1352,7 @@
m.elements.importExtensionSettings = function(prj)
return {
m.importRuleSettings,
m.importBuildCustomizationsProps
}
end
@ -1362,6 +1370,12 @@
end
end
function m.importBuildCustomizationsProps(prj)
for i, build in ipairs(prj.buildcustomizations) do
premake.w('<Import Project="$(VCTargetsPath)\\BuildCustomizations\\%s.props" />', path.translate(build))
end
end
function m.importLibrary(cfg)