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 26if isVisualStudio then 27 debugdir ("Bin") 28end 29 30 31 local config_list = { 32 "Release", 33 "Debug", 34 "Instrumented_Release", 35 "Instrumented_Debug" 36 } 37 local platform_list = { 38 "x32", 39 "x64" 40 } 41 42 configurations(config_list) 43 platforms(platform_list) 44 45 46-- CONFIGURATIONS 47 48configuration "Instrumented_Release" 49 defines { "NDEBUG", "MT_INSTRUMENTED_BUILD" } 50 flags { "Symbols", optimization_flags } 51 52configuration "Instrumented_Debug" 53 defines { "_DEBUG", "MT_INSTRUMENTED_BUILD", "_CRTDBG_MAP_ALLOC" } 54 flags { "Symbols" } 55 56configuration "Release" 57 defines { "NDEBUG" } 58 flags { "Symbols", optimization_flags } 59 60configuration "Debug" 61 defines { "_DEBUG", "_CRTDBG_MAP_ALLOC"} 62 flags { "Symbols" } 63 64configuration "x32" 65if isVisualStudio then 66 buildoptions { "/wd4127" } 67else 68 buildoptions { "-std=c++11" } 69 linkoptions { "-rdynamic" } 70end 71 72configuration "x64" 73if isVisualStudio then 74 buildoptions { "/wd4127" } 75else 76 buildoptions { "-std=c++11" } 77 linkoptions { "-rdynamic" } 78end 79 80 81-- give each configuration/platform a unique output directory 82 83for _, config in ipairs(config_list) do 84 for _, plat in ipairs(platform_list) do 85 configuration { config, plat } 86 objdir ( "Build/" .. _ACTION .. "/tmp/" .. config .. "-" .. plat ) 87 end 88end 89 90os.mkdir("./Bin") 91os.copyfile("./Scheduler/Profiler/filesaver.min.js", "./Bin/filesaver.min.js") 92os.copyfile("./Scheduler/Profiler/jquery.min.js", "./Bin/jquery.min.js") 93os.copyfile("./Scheduler/Profiler/jquery.mousewheel.min.js", "./Bin/jquery.mousewheel.min.js") 94os.copyfile("./Scheduler/Profiler/w2ui.min.js", "./Bin/w2ui.min.js") 95 96os.copyfile("./Scheduler/Profiler/Profiler.html", "./Bin/Profiler.html") 97 98os.copyfile("./Scheduler/Profiler/w2ui-dark.min.css", "./Bin/w2ui-dark.min.css") 99 100-- SUBPROJECTS 101 102 103project "UnitTest++" 104 kind "StaticLib" 105 defines { "_CRT_SECURE_NO_WARNINGS" } 106 files { 107 "TestFramework/UnitTest++/**.cpp", 108 "TestFramework/UnitTest++/**.h", 109 } 110 111if isPosix then 112 excludes { "TestFramework/UnitTest++/Win32/**.*" } 113else 114 excludes { "TestFramework/UnitTest++/Posix/**.*" } 115end 116 117 118project "Squish" 119 kind "StaticLib" 120 defines { "_CRT_SECURE_NO_WARNINGS" } 121 files { 122 "Squish/**.*", 123 } 124 125 includedirs 126 { 127 "Squish" 128 } 129 130 131project "TaskScheduler" 132 kind "StaticLib" 133 flags {"NoPCH"} 134 files { 135 "Scheduler/**.*", 136 } 137 138 includedirs 139 { 140 "Squish", "Scheduler/Include", "TestFramework/UnitTest++" 141 } 142 143 if isPosix then 144 excludes { "Src/Platform/Windows/**.*" } 145 else 146 excludes { "Src/Platform/Posix/**.*" } 147 end 148 149project "Tests" 150 flags {"NoPCH"} 151 kind "ConsoleApp" 152 files { 153 "Tests/**.*", 154 } 155 156 includedirs 157 { 158 "Squish", "Scheduler/Include", "TestFramework/UnitTest++" 159 } 160 161 if isPosix then 162 excludes { "Src/Platform/Windows/**.*" } 163 else 164 excludes { "Src/Platform/Posix/**.*" } 165 end 166 167 links { 168 "UnitTest++", "Squish", "TaskScheduler" 169 } 170 171 if isPosix then 172 links { "pthread" } 173 end 174 175 if isVisualStudio then 176 links { "Ws2_32" } 177 end 178 179 180