forked from d-led/picojson_serializer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake4.lua
76 lines (65 loc) · 1.73 KB
/
premake4.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
local OS=os.get()
local definitions = {
dir = {
linux = "ls",
windows = "dir"
}
}
local cfg={}
for i,v in pairs(definitions) do
cfg[i]=definitions[i][OS]
end
-- Apply to current "filter" (solution/project)
function DefaultConfig()
location "Build"
configuration "Debug"
defines { "DEBUG", "_DEBUG" }
objdir "Build/obj"
targetdir "Build/Debug"
flags { "Symbols" }
configuration "Release"
defines { "RELEASE" }
objdir "Build/obj"
targetdir "Build/Release"
flags { "Optimize" }
configuration "*" -- to reset configuration filter
end
function CompilerSpecificConfiguration()
configuration {"xcode*" }
--postbuildcommands {"$TARGET_BUILD_DIR/$TARGET_NAME"}
configuration {"gmake"}
postbuildcommands { "$(TARGET)" }
buildoptions { "-std=c++0x" }
configuration {"codeblocks" }
postbuildcommands { "$(TARGET_OUTPUT_FILE)"}
configuration { "vs*"}
postbuildcommands { "\"$(TargetPath)\"" }
end
-- A solution contains projects, and defines the available configurations
local sln=solution "picojson_serializer"
location "Build"
sln.absbasedir=path.getabsolute(sln.basedir)
configurations { "Debug", "Release" }
platforms { "native" , "x32", "x64" }
includedirs {
sln.basedir,
path.join(sln.basedir,"Catch/single_include"),
path.join(sln.basedir,"picojson"),
path.join(sln.basedir,"test")
}
vpaths {
["Headers"] = "**.h",
["Sources"] = {"**.cc", "**.cpp"},
}
----------------------------------------------------------------------------------------------------------------
local tests=project "test"
local basedir="test"
kind "ConsoleApp"
DefaultConfig()
language "C++"
files {
path.join(basedir,"**.cpp"),
path.join(basedir,"**.h"),
path.join(basedir,"../*.h")
}
CompilerSpecificConfiguration()