зеркало из https://github.com/mono/CppSharp.git
Reworked parser bindings build scripts to be more easily re-usable.
This commit is contained in:
Родитель
459421128a
Коммит
d349134180
|
@ -1,19 +0,0 @@
|
|||
function SetupCLIParser()
|
||||
links { "CppSharp.Parser.CLI" }
|
||||
end
|
||||
|
||||
function SetupCSharpParser()
|
||||
links
|
||||
{
|
||||
"CppSharp.Parser.CSharp",
|
||||
"CppSharp.Runtime"
|
||||
}
|
||||
end
|
||||
|
||||
function SetupParser()
|
||||
if string.match(action, "vs*") and os.is("windows") then
|
||||
SetupCLIParser()
|
||||
else
|
||||
SetupCSharpParser()
|
||||
end
|
||||
end
|
|
@ -5,9 +5,7 @@
|
|||
config = {}
|
||||
|
||||
dofile "Helpers.lua"
|
||||
dofile "Tests.lua"
|
||||
dofile "LLVM.lua"
|
||||
dofile "Parser.lua"
|
||||
|
||||
solution "CppSharp"
|
||||
|
||||
|
@ -26,22 +24,26 @@ solution "CppSharp"
|
|||
defines { "WINDOWS" }
|
||||
|
||||
configuration {}
|
||||
|
||||
|
||||
group "Libraries"
|
||||
include (srcdir .. "/Core")
|
||||
include (srcdir .. "/AST")
|
||||
include (srcdir .. "/CppParser")
|
||||
include (srcdir .. "/CppParser/Bindings")
|
||||
include (srcdir .. "/CppParser/ParserGen")
|
||||
include (srcdir .. "/Parser")
|
||||
include (srcdir .. "/Generator")
|
||||
include (srcdir .. "/Generator.Tests")
|
||||
include (srcdir .. "/Runtime")
|
||||
|
||||
dofile "Tests.lua"
|
||||
|
||||
group "Tests"
|
||||
IncludeTests()
|
||||
|
||||
if string.starts(action, "vs") then
|
||||
|
||||
group "Examples"
|
||||
IncludeExamples()
|
||||
|
||||
end
|
||||
|
||||
group "Tests"
|
||||
IncludeTests()
|
||||
|
||||
group "Libraries"
|
||||
include (srcdir .. "/Core")
|
||||
include (srcdir .. "/AST")
|
||||
include (srcdir .. "/Generator")
|
||||
include (srcdir .. "/Generator.Tests")
|
||||
include (srcdir .. "/Runtime")
|
||||
include (srcdir .. "/Parser")
|
||||
include (srcdir .. "/CppParser")
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
include "../../../../build/LLVM.lua"
|
||||
|
||||
project "CppSharp.Parser.CLI"
|
||||
|
||||
kind "SharedLib"
|
||||
language "C++"
|
||||
SetupNativeProject()
|
||||
SetupLLVMIncludes()
|
||||
|
||||
dependson { "CppSharp.CppParser" }
|
||||
flags { common_flags, "Managed" }
|
||||
|
||||
configuration "vs*"
|
||||
buildoptions { clang_msvc_flags }
|
||||
|
||||
configuration "*"
|
||||
|
||||
files
|
||||
{
|
||||
"**.h",
|
||||
"**.cpp",
|
||||
"**.lua"
|
||||
}
|
||||
|
||||
includedirs
|
||||
{
|
||||
"../../../../include/",
|
||||
"../../../../src/CppParser/"
|
||||
}
|
||||
|
||||
configuration "*"
|
||||
|
||||
links { "CppSharp.CppParser" }
|
||||
|
||||
function SetupParser()
|
||||
links { "CppSharp.Parser.CLI" }
|
||||
end
|
|
@ -0,0 +1,43 @@
|
|||
project "CppSharp.Parser.CSharp"
|
||||
|
||||
SetupManagedProject()
|
||||
|
||||
kind "SharedLib"
|
||||
language "C#"
|
||||
clr "Unsafe"
|
||||
|
||||
dependson { "CppSharp.CppParser" }
|
||||
|
||||
files
|
||||
{
|
||||
"**.lua"
|
||||
}
|
||||
|
||||
links { "CppSharp.Runtime" }
|
||||
|
||||
if os.is("windows") then
|
||||
files { "i686-pc-win32-msvc/**.cs" }
|
||||
elseif os.is("macosx") then
|
||||
local file = io.popen("lipo -info `which mono`")
|
||||
local output = file:read('*all')
|
||||
if string.find(output, "x86_64") then
|
||||
files { "x86_64-apple-darwin12.4.0/**.cs" }
|
||||
else
|
||||
files { "i686-apple-darwin12.4.0/**.cs" }
|
||||
end
|
||||
|
||||
elseif os.is("linux") then
|
||||
files { "x86_64-linux-gnu/**.cs" }
|
||||
else
|
||||
print "Unknown architecture"
|
||||
end
|
||||
|
||||
configuration ""
|
||||
|
||||
function SetupParser()
|
||||
links
|
||||
{
|
||||
"CppSharp.Parser.CSharp",
|
||||
"CppSharp.Runtime"
|
||||
}
|
||||
end
|
|
@ -1,70 +1,7 @@
|
|||
include "../../../build/LLVM.lua"
|
||||
|
||||
project "CppSharp.Parser.CSharp"
|
||||
|
||||
SetupManagedProject()
|
||||
|
||||
kind "SharedLib"
|
||||
language "C#"
|
||||
clr "Unsafe"
|
||||
|
||||
dependson { "CppSharp.CppParser" }
|
||||
|
||||
files
|
||||
{
|
||||
"**.lua"
|
||||
}
|
||||
|
||||
links { "CppSharp.Runtime" }
|
||||
|
||||
if os.is("windows") then
|
||||
files { "CSharp/i686-pc-win32-msvc/**.cs" }
|
||||
elseif os.is("macosx") then
|
||||
local file = io.popen("lipo -info `which mono`")
|
||||
local output = file:read('*all')
|
||||
if string.find(output, "x86_64") then
|
||||
files { "CSharp/x86_64-apple-darwin12.4.0/**.cs" }
|
||||
else
|
||||
files { "CSharp/i686-apple-darwin12.4.0/**.cs" }
|
||||
end
|
||||
|
||||
elseif os.is("linux") then
|
||||
files { "CSharp/x86_64-linux-gnu/**.cs" }
|
||||
else
|
||||
print "Unknown architecture"
|
||||
end
|
||||
|
||||
configuration ""
|
||||
include ("CSharp")
|
||||
|
||||
if string.starts(action, "vs") and os.is("windows") then
|
||||
|
||||
project "CppSharp.Parser.CLI"
|
||||
|
||||
kind "SharedLib"
|
||||
language "C++"
|
||||
SetupNativeProject()
|
||||
SetupLLVMIncludes()
|
||||
|
||||
dependson { "CppSharp.CppParser" }
|
||||
flags { common_flags, "Managed" }
|
||||
include ("CLI")
|
||||
|
||||
configuration "vs*"
|
||||
buildoptions { clang_msvc_flags }
|
||||
|
||||
configuration "*"
|
||||
|
||||
files
|
||||
{
|
||||
"CLI/AST.h",
|
||||
"CLI/AST.cpp",
|
||||
"CLI/**.h",
|
||||
"CLI/**.cpp",
|
||||
"**.lua"
|
||||
}
|
||||
|
||||
includedirs { "../../../include/", "../../../src/CppParser/" }
|
||||
|
||||
configuration "*"
|
||||
links { "CppSharp.CppParser" }
|
||||
|
||||
end
|
||||
end
|
|
@ -38,7 +38,4 @@ project "CppSharp.CppParser"
|
|||
|
||||
configuration "*"
|
||||
|
||||
end
|
||||
|
||||
include ("Bindings")
|
||||
include ("ParserGen")
|
||||
end
|
|
@ -1,5 +1,3 @@
|
|||
include("../../build/Parser.lua")
|
||||
|
||||
project "CppSharp.Parser"
|
||||
|
||||
SetupManagedProject()
|
||||
|
|
Загрузка…
Ссылка в новой задаче