Skip to content

Commit f5730a1

Browse files
tritaoddobrev
authored andcommitted
Added some Premake scripts.
1 parent 35b11b1 commit f5730a1

File tree

6 files changed

+171
-0
lines changed

6 files changed

+171
-0
lines changed

QtSharp.CLI/premake5.lua

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
project "QtSharp.CLI"
2+
3+
kind "ConsoleApp"
4+
language "C#"
5+
6+
SetupCppSharp()
7+
SetupManagedProject()
8+
9+
--debugargs { "C:\Qt\Qt5.3.2\5.3\mingw482_32\bin\qmake.exe C:\Qt\Qt5.3.2\Tools\mingw482_32\bin\mingw32-make.exe" }
10+
11+
files { "*.cs" }
12+
links { "System", "System.Core", "QtSharp" }

QtSharp.Tests/premake5.lua

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
project "QtSharp.Tests"
2+
3+
kind "SharedLib"
4+
language "C#"
5+
flags { "Unsafe" }
6+
7+
SetupManagedProject()
8+
9+
files { "*.cs" }
10+
links { "System", "System.Core" }

QtSharp/premake5.lua

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
project "QtSharp"
2+
3+
kind "SharedLib"
4+
language "C#"
5+
flags { "Unsafe" }
6+
7+
SetupCppSharp()
8+
SetupManagedProject()
9+
10+
files { "*.cs" }
11+
excludes { "QEvent*", "Marshal*", "QObject*" }
12+
13+
libdirs { "../References" }
14+
links
15+
{
16+
"System",
17+
"System.Core",
18+
"System.Data",
19+
"Mono.Data.Sqlite",
20+
"zlib.net",
21+
}

build/GenerateProjects.bat

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@echo off
2+
goto menu
3+
4+
:menu
5+
echo Build Project Generator:
6+
echo.
7+
echo [0] Clean
8+
echo [1] Visual C++ 2013
9+
echo [3] GNU Make
10+
echo.
11+
12+
:choice
13+
set /P C="Choice: "
14+
if "%C%"=="3" goto gmake
15+
if "%C%"=="1" goto vs2013
16+
if "%C%"=="0" goto clean
17+
18+
:clean
19+
"premake5" --file=premake5.lua clean
20+
goto quit
21+
22+
:vs2013
23+
"premake5" --file=premake5.lua vs2013
24+
goto quit
25+
26+
:gmake
27+
"premake5" --file=premake5.lua gmake
28+
goto quit
29+
30+
:quit
31+
pause
32+
:end

build/Helpers.lua

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
-- This module checks for the all the project dependencies.
2+
3+
action = _ACTION or ""
4+
5+
depsdir = path.getabsolute("../deps");
6+
srcdir = path.getabsolute("..");
7+
incdir = path.getabsolute("../include");
8+
bindir = path.getabsolute("../bin");
9+
examplesdir = path.getabsolute("../examples");
10+
testsdir = path.getabsolute("../tests");
11+
12+
builddir = path.getabsolute("./" .. action);
13+
if _ARGS[1] then
14+
builddir = path.getabsolute("./" .. _ARGS[1]);
15+
end
16+
17+
libdir = path.join(builddir, "lib", "%{cfg.buildcfg}_%{cfg.platform}");
18+
gendir = path.join(builddir, "gen");
19+
20+
common_flags = { "Unicode", "Symbols" }
21+
22+
function os.is_osx()
23+
return os.is("macosx")
24+
end
25+
26+
function os.is_windows()
27+
return os.is("windows")
28+
end
29+
30+
function os.is_linux()
31+
return os.is("linux")
32+
end
33+
34+
function string.starts(str, start)
35+
return string.sub(str, 1, string.len(start)) == start
36+
end
37+
38+
function SafePath(path)
39+
return "\"" .. path .. "\""
40+
end
41+
42+
43+
cppSharpLocation = path.getabsolute("../../CppSharp/build/vs2013/lib/Release_x32/")
44+
45+
function SetupCppSharp()
46+
libdirs { cppSharpLocation }
47+
links
48+
{
49+
"CppSharp",
50+
"CppSharp.AST",
51+
"CppSharp.Parser.CLI",
52+
"CppSharp.Generator",
53+
}
54+
end
55+
56+
function SetupManagedProject()
57+
language "C#"
58+
location (path.join(builddir, "projects"))
59+
60+
if not os.is_osx() then
61+
local c = configuration { "vs*" }
62+
location "."
63+
configuration(c)
64+
end
65+
end
66+

build/premake5.lua

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- This is the starting point of the build scripts for the project.
2+
-- It defines the common build settings that all the projects share
3+
-- and calls the build scripts of all the sub-projects.
4+
5+
dofile "Helpers.lua"
6+
7+
solution "QtSharp"
8+
9+
configurations { "Debug", "Release" }
10+
platforms { "x32", "x64" }
11+
flags { common_flags }
12+
13+
location (builddir)
14+
objdir (path.join(builddir, "obj"))
15+
targetdir (libdir)
16+
debugdir (bindir)
17+
18+
-- startproject "Generator"
19+
configuration "vs2013"
20+
framework "4.0"
21+
22+
configuration "vs2012"
23+
framework "4.0"
24+
25+
configuration "windows"
26+
defines { "WINDOWS" }
27+
28+
include (srcdir .. "/QtSharp")
29+
include (srcdir .. "/QtSharp.CLI")
30+
include (srcdir .. "/QtSharp.Tests")

0 commit comments

Comments
 (0)