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