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" } 69end 70 71configuration "x64" 72if isVisualStudio then 73 buildoptions { "/wd4127" } 74else 75 buildoptions { "-std=c++11" } 76end 77 78 79-- give each configuration/platform a unique output directory 80 81for _, config in ipairs(config_list) do 82 for _, plat in ipairs(platform_list) do 83 configuration { config, plat } 84 objdir ( "Build/" .. _ACTION .. "/tmp/" .. config .. "-" .. plat ) 85 end 86end 87 88 89os.copyfile("./Scheduler/Profiler/filesaver.min.js", "./Bin/filesaver.min.js") 90os.copyfile("./Scheduler/Profiler/jquery.min.js", "./Bin/jquery.min.js") 91os.copyfile("./Scheduler/Profiler/jquery.mousewheel.min.js", "./Bin/jquery.mousewheel.min.js") 92os.copyfile("./Scheduler/Profiler/w2ui.min.js", "./Bin/w2ui.min.js") 93 94os.copyfile("./Scheduler/Profiler/Profiler.html", "./Bin/Profiler.html") 95 96os.copyfile("./Scheduler/Profiler/w2ui-dark.min.css", "./Bin/w2ui-dark.min.css") 97 98-- SUBPROJECTS 99 100 101project "UnitTest++" 102 kind "StaticLib" 103 defines { "_CRT_SECURE_NO_WARNINGS" } 104 files { 105 "TestFramework/UnitTest++/**.cpp", 106 "TestFramework/UnitTest++/**.h", 107 } 108 109if isPosix then 110 excludes { "TestFramework/UnitTest++/Win32/**.*" } 111else 112 excludes { "TestFramework/UnitTest++/Posix/**.*" } 113end 114 115 116project "Squish" 117 kind "StaticLib" 118 defines { "_CRT_SECURE_NO_WARNINGS" } 119 files { 120 "Squish/**.*", 121 } 122 123 includedirs 124 { 125 "Squish" 126 } 127 128 129project "TaskScheduler" 130 kind "StaticLib" 131 flags {"NoPCH"} 132 files { 133 "Scheduler/**.*", 134 } 135 136 includedirs 137 { 138 "Squish", "Scheduler/Include", "TestFramework/UnitTest++" 139 } 140 141 if isPosix then 142 excludes { "Src/Platform/Windows/**.*" } 143 else 144 excludes { "Src/Platform/Posix/**.*" } 145 end 146 147project "Tests" 148 flags {"NoPCH"} 149 kind "ConsoleApp" 150 files { 151 "Tests/**.*", 152 } 153 154 includedirs 155 { 156 "Squish", "Scheduler/Include", "TestFramework/UnitTest++" 157 } 158 159 if isPosix then 160 excludes { "Src/Platform/Windows/**.*" } 161 else 162 excludes { "Src/Platform/Posix/**.*" } 163 end 164 165 links { 166 "UnitTest++", "Squish", "TaskScheduler" 167 } 168 169 if isPosix then 170 links { "pthread" } 171 end 172 173 if isVisualStudio then 174 links { "Ws2_32" } 175 end 176 177 178