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" 60 libdirs { "$(DXSDK_DIR)/Lib/x86" } 61if isVisualStudio then 62 buildoptions { "/wd4127" } 63else 64 buildoptions { "-std=c++11" } 65end 66 67configuration "x64" 68 libdirs { "$(DXSDK_DIR)/Lib/x64" } 69if isVisualStudio then 70 buildoptions { "/wd4127" } 71else 72 buildoptions { "-std=c++11" } 73end 74 75 76-- give each configuration/platform a unique output directory 77 78for _, config in ipairs(config_list) do 79 for _, plat in ipairs(platform_list) do 80 configuration { config, plat } 81 objdir ( "build/" .. _ACTION .. "/tmp/" .. config .. "-" .. plat ) 82 end 83end 84 85-- SUBPROJECTS 86 87project "Tests" 88 flags {"NoPCH"} 89 kind "ConsoleApp" 90 files { 91 "Tests/**.*", 92 } 93 94 includedirs 95 { 96 "Squish", "Scheduler/Include", "TestFramework/UnitTest++" 97 } 98 99 if isPosix then 100 excludes { "Src/Platform/Windows/**.*" } 101 else 102 excludes { "Src/Platform/Posix/**.*" } 103 end 104 105 links { 106 "UnitTest++", "Squish", "TaskScheduler" 107 } 108 109 if isPosix then 110 links { "pthread" } 111 end 112 113project "TaskScheduler" 114 kind "StaticLib" 115 flags {"NoPCH"} 116 files { 117 "Scheduler/**.*", 118 } 119 120 includedirs 121 { 122 "Squish", "Scheduler/Include", "TestFramework/UnitTest++" 123 } 124 125 if isPosix then 126 excludes { "Src/Platform/Windows/**.*" } 127 else 128 excludes { "Src/Platform/Posix/**.*" } 129 end 130 131 132project "UnitTest++" 133 kind "StaticLib" 134 defines { "_CRT_SECURE_NO_WARNINGS" } 135 files { 136 "TestFramework/UnitTest++/**.cpp", 137 "TestFramework/UnitTest++/**.h", 138 } 139 140if isPosix then 141 excludes { "TestFramework/UnitTest++/Win32/**.*" } 142else 143 excludes { "TestFramework/UnitTest++/Posix/**.*" } 144end 145 146 147project "Squish" 148 kind "StaticLib" 149 defines { "_CRT_SECURE_NO_WARNINGS" } 150 files { 151 "Squish/**.*", 152 } 153 154 includedirs 155 { 156 "Squish" 157 } 158 159 160