forked from paulftw/hiberlite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
96 lines (78 loc) · 2.22 KB
/
premake5.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
function CompilerSpecificFlags()
filter { "action:vs*" }
defines {
"_CRT_SECURE_NO_DEPRECATE",
"_CRT_NONSTDC_NO_DEPRECATE"
}
filter { "action:gmake" }
buildoptions { "-std=c++0x" }
filter {} -- to reset configuration filter
end
function RunTargetAfterBuild()
configuration {"xcode*" }
postbuildcommands {"$TARGET_BUILD_DIR/$TARGET_NAME"}
configuration {"gmake"}
postbuildcommands { "$(TARGET)" }
configuration {"codeblocks" }
postbuildcommands { "$(TARGET_OUTPUT_FILE)"}
configuration { "vs*"}
postbuildcommands { "\"$(TargetPath)\"" }
configuration "*" -- to reset configuration filter
end
solution "hiberlite"
location "Build"
platforms { "native", "x32", "x64" }
configurations { "Debug", "Release" }
objdir "obj/%{prj.name}/%{cfg.buildcfg}"
targetdir "bin/%{prj.name}/%{cfg.buildcfg}"
includedirs {
[[./include]],
[[./sqlite-amalgamation]],
[[./Catch/single_include]]
}
vpaths {
["Headers"] = {"**.h","**.hpp"},
["Sources"] = {"**.c", "**.cpp"},
}
filter { "configurations:Debug" }
defines { "DEBUG", "_DEBUG" }
flags { "Symbols" }
filter { "configurations:Release" }
defines { "RELEASE" }
flags { "Optimize" }
filter {}
----------------------------------------------------------------------------------------------------------------
project "hiberlite"
language "C++"
location "Build"
kind "StaticLib"
CompilerSpecificFlags()
files {
"./include/*.h",
"./include/*.hpp",
"./src/*.cpp",
}
----------------------------------------------------------------------------------------------------------------
project "sqlite"
language "C"
kind "StaticLib"
files {
"./sqlite-amalgamation/*.h",
"./sqlite-amalgamation/*.c",
}
----------------------------------------------------------------------------------------------------------------
function default_project(name,files_table)
project(name)
language "C++"
kind "ConsoleApp"
files(files_table)
links { "hiberlite", "sqlite" }
CompilerSpecificFlags()
RunTargetAfterBuild()
filter {"system:linux"}
links { "dl" , "pthread" }
filter {}
end
default_project("sample",{ "./sample.cpp" })
default_project("catch_test",{ "./catch_tests.cpp" })
default_project("hiberlite_test",{ "./tests.cpp" })