xref: /TaskScheduler/premake4.lua (revision 31bebe6f)
1if not _ACTION then
2	_ACTION="vs2010"
3end
4
5isPOSIX = false
6isVisualStudio = false
7
8if _ACTION == "vs2002" or _ACTION == "vs2003" or _ACTION == "vs2005" or _ACTION == "vs2008" or _ACTION == "vs2010" then
9	isVisualStudio = true
10end
11
12if _ACTION == "codeblocks" or _ACTION == "gmake"
13then
14	isPosix = true
15end
16
17solution "TaskScheduler"
18
19	language "C++"
20
21	location ( "Build/" .. _ACTION )
22	flags {"NoManifest", "ExtraWarnings", "StaticRuntime", "NoMinimalRebuild", "FloatFast", "EnableSSE2" }
23	optimization_flags = { "OptimizeSpeed" }
24	targetdir("Bin")
25	debugdir ("Bin")
26
27	local config_list = {
28		"Release",
29		"Debug",
30                "Instrumented_Release",
31                "Instrumented_Debug"
32	}
33	local platform_list = {
34		"x32",
35		"x64"
36	}
37
38	configurations(config_list)
39	platforms(platform_list)
40
41
42-- CONFIGURATIONS
43
44configuration "Instrumented_Release"
45	defines { "NDEBUG", "MT_INSTRUMENTED_BUILD" }
46	flags { "Symbols", optimization_flags }
47
48configuration "Instrumented_Debug"
49	defines { "_DEBUG", "MT_INSTRUMENTED_BUILD", "_CRTDBG_MAP_ALLOC" }
50	flags { "Symbols" }
51
52configuration "Release"
53	defines { "NDEBUG" }
54	flags { "Symbols", optimization_flags }
55
56configuration "Debug"
57	defines { "_DEBUG", "_CRTDBG_MAP_ALLOC"}
58	flags { "Symbols" }
59
60configuration "x32"
61if isVisualStudio then
62        buildoptions { "/wd4127"  }
63else
64	buildoptions { "-std=c++11" }
65end
66
67configuration "x64"
68if isVisualStudio then
69        buildoptions { "/wd4127"  }
70else
71	buildoptions { "-std=c++11" }
72end
73
74
75--  give each configuration/platform a unique output directory
76
77for _, config in ipairs(config_list) do
78	for _, plat in ipairs(platform_list) do
79		configuration { config, plat }
80		objdir    ( "Build/" .. _ACTION .. "/tmp/"  .. config  .. "-" .. plat )
81	end
82end
83
84
85os.copyfile("./Scheduler/Profiler/filesaver.min.js", "./Bin/filesaver.min.js")
86os.copyfile("./Scheduler/Profiler/jquery.min.js", "./Bin/jquery.min.js")
87os.copyfile("./Scheduler/Profiler/jquery.mousewheel.min.js", "./Bin/jquery.mousewheel.min.js")
88os.copyfile("./Scheduler/Profiler/w2ui.min.js", "./Bin/w2ui.min.js")
89
90os.copyfile("./Scheduler/Profiler/Profiler.html", "./Bin/Profiler.html")
91
92os.copyfile("./Scheduler/Profiler/w2ui-dark.min.css", "./Bin/w2ui-dark.min.css")
93
94-- SUBPROJECTS
95
96
97project "UnitTest++"
98	kind "StaticLib"
99	defines { "_CRT_SECURE_NO_WARNINGS" }
100	files {
101		"TestFramework/UnitTest++/**.cpp",
102                "TestFramework/UnitTest++/**.h",
103	}
104
105if isPosix then
106	excludes { "TestFramework/UnitTest++/Win32/**.*" }
107else
108	excludes { "TestFramework/UnitTest++/Posix/**.*" }
109end
110
111
112project "Squish"
113	kind "StaticLib"
114	defines { "_CRT_SECURE_NO_WARNINGS" }
115	files {
116		"Squish/**.*",
117	}
118
119	includedirs
120	{
121		"Squish"
122	}
123
124
125project "TaskScheduler"
126        kind "StaticLib"
127 	flags {"NoPCH"}
128 	files {
129 		"Scheduler/**.*",
130 	}
131
132	includedirs
133	{
134		"Squish", "Scheduler/Include", "TestFramework/UnitTest++"
135	}
136
137	if isPosix then
138	excludes { "Src/Platform/Windows/**.*" }
139	else
140	excludes { "Src/Platform/Posix/**.*" }
141	end
142
143project "Tests"
144 	flags {"NoPCH"}
145 	kind "ConsoleApp"
146 	files {
147 		"Tests/**.*",
148 	}
149
150	includedirs
151	{
152		"Squish", "Scheduler/Include", "TestFramework/UnitTest++"
153	}
154
155	if isPosix then
156	excludes { "Src/Platform/Windows/**.*" }
157	else
158	excludes { "Src/Platform/Posix/**.*" }
159	end
160
161	links {
162		"UnitTest++", "Squish", "TaskScheduler"
163	}
164
165	if isPosix then
166		links { "pthread" }
167	end
168
169	if isVisualStudio then
170		links { "Ws2_32" }
171	end
172
173
174