xref: /TaskScheduler/premake4.lua (revision f25ce65d)
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"
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
26	local config_list = {
27		"Release",
28		"Debug",
29	}
30	local platform_list = {
31		"x32",
32		"x64"
33	}
34
35	configurations(config_list)
36	platforms(platform_list)
37
38
39-- CONFIGURATIONS
40
41configuration "Release"
42	defines { "NDEBUG" }
43	flags { "Symbols", optimization_flags }
44
45configuration "Debug"
46	defines { "_DEBUG" }
47	flags { "Symbols" }
48
49configuration "x32"
50	libdirs { "$(DXSDK_DIR)/Lib/x86" }
51if isVisualStudio then
52        buildoptions { "/wd4127"  }
53else
54	buildoptions { "-std=c++11" }
55end
56
57configuration "x64"
58	libdirs { "$(DXSDK_DIR)/Lib/x64" }
59if isVisualStudio then
60        buildoptions { "/wd4127"  }
61else
62	buildoptions { "-std=c++11" }
63end
64
65
66--  give each configuration/platform a unique output directory
67
68for _, config in ipairs(config_list) do
69	for _, plat in ipairs(platform_list) do
70		configuration { config, plat }
71		objdir    ( "build/" .. _ACTION .. "/tmp/"  .. config  .. "-" .. plat )
72	end
73end
74
75-- SUBPROJECTS
76
77project "Tests"
78 	flags {"NoPCH"}
79 	kind "ConsoleApp"
80 	files {
81 		"Tests/**.*",
82 	}
83
84	includedirs
85	{
86		"Squish", "Scheduler/Include", "TestFramework/UnitTest++"
87	}
88
89	if isPosix then
90	excludes { "Src/Platform/Windows/**.*" }
91	else
92	excludes { "Src/Platform/Posix/**.*" }
93	end
94
95	links {
96		"UnitTest++", "Squish", "TaskScheduler"
97	}
98
99
100project "TaskScheduler"
101        kind "StaticLib"
102 	flags {"NoPCH"}
103 	files {
104 		"Scheduler/**.*",
105 	}
106
107	includedirs
108	{
109		"Squish", "Scheduler/Include", "TestFramework/UnitTest++"
110	}
111
112	if isPosix then
113	excludes { "Src/Platform/Windows/**.*" }
114	else
115	excludes { "Src/Platform/Posix/**.*" }
116	end
117
118	if isPosix then
119		links { "pthread" }
120	end
121
122
123
124project "UnitTest++"
125	kind "StaticLib"
126	defines { "_CRT_SECURE_NO_WARNINGS" }
127	files {
128		"TestFramework/UnitTest++/**.*",
129	}
130
131if isPosix then
132	excludes { "TestFramework/UnitTest++/Win32/**.*" }
133else
134	excludes { "TestFramework/UnitTest++/Posix/**.*" }
135end
136
137
138project "Squish"
139	kind "StaticLib"
140	defines { "_CRT_SECURE_NO_WARNINGS" }
141	files {
142		"Squish/**.*",
143	}
144
145	includedirs
146	{
147		"Squish"
148	}
149
150
151