Browse Source

Reworked parser bindings build scripts to be more easily re-usable.

pull/696/head
Joao Matos 9 years ago
parent
commit
d349134180
  1. 19
      build/Parser.lua
  2. 30
      build/premake5.lua
  3. 37
      src/CppParser/Bindings/CLI/premake5.lua
  4. 43
      src/CppParser/Bindings/CSharp/premake5.lua
  5. 67
      src/CppParser/Bindings/premake5.lua
  6. 3
      src/CppParser/premake5.lua
  7. 2
      src/Parser/premake5.lua

19
build/Parser.lua

@ -1,19 +0,0 @@ @@ -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

30
build/premake5.lua

@ -5,9 +5,7 @@ @@ -5,9 +5,7 @@
config = {}
dofile "Helpers.lua"
dofile "Tests.lua"
dofile "LLVM.lua"
dofile "Parser.lua"
solution "CppSharp"
@ -27,21 +25,25 @@ solution "CppSharp" @@ -27,21 +25,25 @@ solution "CppSharp"
configuration {}
if string.starts(action, "vs") then
group "Examples"
IncludeExamples()
end
group "Tests"
IncludeTests()
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")
include (srcdir .. "/Parser")
include (srcdir .. "/CppParser")
dofile "Tests.lua"
group "Tests"
IncludeTests()
if string.starts(action, "vs") then
group "Examples"
IncludeExamples()
end

37
src/CppParser/Bindings/CLI/premake5.lua

@ -0,0 +1,37 @@ @@ -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

43
src/CppParser/Bindings/CSharp/premake5.lua

@ -0,0 +1,43 @@ @@ -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

67
src/CppParser/Bindings/premake5.lua

@ -1,70 +1,7 @@ @@ -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" }
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" }
include ("CLI")
end

3
src/CppParser/premake5.lua

@ -39,6 +39,3 @@ project "CppSharp.CppParser" @@ -39,6 +39,3 @@ project "CppSharp.CppParser"
configuration "*"
end
include ("Bindings")
include ("ParserGen")

2
src/Parser/premake5.lua

@ -1,5 +1,3 @@ @@ -1,5 +1,3 @@
include("../../build/Parser.lua")
project "CppSharp.Parser"
SetupManagedProject()

Loading…
Cancel
Save