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