This repository has been archived by the owner on Jan 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpremake4.lua
87 lines (76 loc) · 1.98 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
77
78
79
80
81
82
83
84
85
86
87
local OS=os.get()
local definitions = {
dir = {
linux = "ls",
windows = "dir"
},
BOOST = {
linux = "/usr/include", --customize
windows = os.getenv("BOOST")
},
BOOST_LIB = {
linux = "/usr/local/lib", --customize
windows = path.join(os.getenv("BOOST"),"stage/lib")
},
links = {
}
}
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", "CATCH_CONFIG_CPP11_NULLPTR" }
objdir "Build/obj"
targetdir "Build/Debug"
flags { "Symbols" }
configuration "Release"
defines { "RELEASE", "CATCH_CONFIG_CPP11_NULLPTR" }
objdir "Build/obj"
targetdir "Build/Release"
flags { "Optimize" }
configuration "*" -- to reset configuration filter
end
function SetUpCompilerSpecificPostBuildEvent()
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 "undo-redo"
location "Build"
sln.absbasedir=path.getabsolute(sln.basedir)
configurations { "Debug", "Release" }
platforms { "native", "x32", "x64" }
includedirs {
sln.basedir,
path.join(sln.basedir,"undoredo"),
path.join(sln.basedir,"Catch/single_include")
}
vpaths {
["Headers"] = "**.h",
["Sources"] = {"**.cc", "**.cpp"},
}
----------------------------------------------------------------------------------------------------------------
local undoredotests=project "undoredotests"
local basedir="undoredotests"
kind "ConsoleApp"
DefaultConfig()
language "C++"
files {
path.join(basedir,"**.cpp"),
path.join(basedir,"**.h")
}
links {
cfg.links
}
SetUpCompilerSpecificPostBuildEvent()