Merged in triton/premake-cs-fixes/cli-usingdirs3 (pull request #75)
Added new function usingdirs() to specify additional C++/CLI using directories.
This commit is contained in:
commit
bff804a03a
@ -39,6 +39,7 @@
|
||||
* Added external files and virtual paths for C# projects (James Whitworth)
|
||||
* Added ReleaseRuntime build flag (Tarmo Pikaro)
|
||||
* Added Component, Form, and UserControl build actions
|
||||
* Added usingdirs() to specify C++/CLI additional using directories (João Matos / triton)
|
||||
|
||||
|
||||
-------
|
||||
|
@ -609,6 +609,13 @@
|
||||
},
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "usingdirs",
|
||||
scope = "config",
|
||||
kind = "directory-list",
|
||||
tokens = true,
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "uuid",
|
||||
scope = "project",
|
||||
|
@ -286,6 +286,7 @@
|
||||
"basicRuntimeChecks",
|
||||
"clCompilePreprocessorDefinitions",
|
||||
"clCompileAdditionalIncludeDirectories",
|
||||
"clCompileAdditionalUsingDirectories",
|
||||
"forceIncludes",
|
||||
"debugInformationFormat",
|
||||
"programDataBaseFileName",
|
||||
@ -657,6 +658,14 @@
|
||||
end
|
||||
end
|
||||
|
||||
function vc2010.additionalUsingDirectories(cfg)
|
||||
if #cfg.usingdirs > 0 then
|
||||
local dirs = project.getrelative(cfg.project, cfg.usingdirs)
|
||||
dirs = path.translate(table.concat(dirs, ";"))
|
||||
_x(3,'<AdditionalUsingDirectories>%s;%%(AdditionalUsingDirectories)</AdditionalUsingDirectories>', dirs)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function vc2010.additionalCompileOptions(cfg, condition)
|
||||
if #cfg.buildoptions > 0 then
|
||||
@ -697,6 +706,10 @@
|
||||
vc2010.additionalIncludeDirectories(cfg, cfg.includedirs)
|
||||
end
|
||||
|
||||
function vc2010.clCompileAdditionalUsingDirectories(cfg)
|
||||
vc2010.additionalUsingDirectories(cfg, cfg.usingdirs)
|
||||
end
|
||||
|
||||
|
||||
function vc2010.clCompilePreprocessorDefinitions(cfg)
|
||||
vc2010.preprocessorDefinitions(cfg, cfg.defines, false)
|
||||
|
@ -268,6 +268,22 @@
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- If include directories are specified, the <AdditionalUsingDirectories> should be added.
|
||||
--
|
||||
|
||||
function suite.additionalUsingDirs_onUsingDirs()
|
||||
usingdirs { "include/lua", "include/zlib" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<AdditionalUsingDirectories>include\lua;include\zlib;%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
]]
|
||||
end
|
||||
|
||||
--
|
||||
-- Turn off minimal rebuilds if the NoMinimalRebuild flag is set.
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user