Browse Source

Split the parser-related build code into its own file.

pull/226/merge
triton 11 years ago
parent
commit
d37822638f
  1. 35
      build/Parser.lua
  2. 41
      build/premake4.lua

35
build/Parser.lua

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
newoption {
trigger = "parser",
description = "Controls which version of the parser is enabled.",
value = "version",
allowed = {
{ "cpp", "Cross-platform C++ parser."},
{ "cli", "VS-only C++/CLI parser."},
}
}
function SetupCLIParser()
local parser = _OPTIONS["parser"]
if not parser or parser == "cli" then
defines { "OLD_PARSER" }
links { "CppSharp.Parser" }
else
links { "CppSharp.Parser.CLI" }
end
end
function SetupCSharpParser()
links
{
"CppSharp.Parser.CSharp",
"CppSharp.Runtime"
}
end
function SetupParser()
if string.match(action, "vs*") then
SetupCLIParser()
else
SetupCSharpParser()
end
end

41
build/premake4.lua

@ -6,45 +6,8 @@ config = {} @@ -6,45 +6,8 @@ config = {}
dofile "Helpers.lua"
dofile "Tests.lua"
-- Setup the LLVM dependency
dofile "LLVM.lua"
newoption {
trigger = "parser",
description = "Controls which version of the parser is enabled.",
value = "version",
allowed = {
{ "cpp", "Cross-platform C++ parser."},
{ "cli", "VS-only C++/CLI parser."},
}
}
function SetupCLIParser()
local parser = _OPTIONS["parser"]
if not parser or parser == "cli" then
defines { "OLD_PARSER" }
links { "CppSharp.Parser" }
else
links { "CppSharp.Parser.CLI" }
end
end
function SetupCSharpParser()
links
{
"CppSharp.Parser.CSharp",
"CppSharp.Runtime"
}
end
function SetupParser()
if string.match(action, "vs*") then
SetupCLIParser()
else
SetupCSharpParser()
end
end
dofile "Parser.lua"
solution "CppSharp"
@ -77,7 +40,7 @@ solution "CppSharp" @@ -77,7 +40,7 @@ solution "CppSharp"
group "Examples"
IncludeExamples()
end
group "Tests"

Loading…
Cancel
Save