77 lines
2 KiB
Lua
77 lines
2 KiB
Lua
-- Visual Studio support, for xenon, durango and win32/64 platforms.
|
|
|
|
-- determine visual studios version
|
|
|
|
vsver = nil;
|
|
if _ACTION == "vs2010" then
|
|
vsver = "10";
|
|
elseif _ACTION == "vs2012" then
|
|
vsver = "11";
|
|
else
|
|
print( "unknown compiler version" )
|
|
assert(false)
|
|
end
|
|
assert(vsver ~= nil)
|
|
assert(platform ~= nil)
|
|
if eal_impl then
|
|
eal_impl.suffix = "_" .. platform .. "_vc" .. vsver
|
|
end
|
|
|
|
require "utils"
|
|
require "solution"
|
|
require "library"
|
|
|
|
MSTestProject = TestProject:New{
|
|
}
|
|
|
|
function MSTestProject:GenerateConfigurations()
|
|
TestProject.GenerateConfigurations(self)
|
|
configuration { "*" }
|
|
buildoptions { "/bigobj", "/wd4503" }
|
|
end
|
|
|
|
MSLibProject = LibProject:New{
|
|
nopch = true
|
|
}
|
|
|
|
MSLibrary = Library:New{
|
|
LibProject = MSLibProject,
|
|
TestProject = MSTestProject,
|
|
}
|
|
|
|
local subdir = joindir(platform, "vc" .. vsver)
|
|
|
|
MSSolution = Solution:New{
|
|
Library = MSLibrary,
|
|
subdir = subdir,
|
|
location = joindir("solutions", subdir),
|
|
platform = platform,
|
|
|
|
msconfigurations = {
|
|
["Debug*"] = {
|
|
flags = { "VS_BasicRuntimeCheck_Both", "VS_BufferSecurityCheck_Yes" },
|
|
},
|
|
["Re*"] = {
|
|
flags = { "VS_Optimization_FullOptim",
|
|
"VS_InlineFunctionExpansion_AnySuitable",
|
|
"VS_EnableIntrinsicFunctions_Yes",
|
|
"VS_FavorSizeOrSpeed_FavorFastCode",
|
|
"VS_EnableFiberSafeOptimizations_Yes",
|
|
"VS_OmitFramePointer_No",
|
|
"VS_BufferSecurityCheck_No",
|
|
"VS_BasicRuntimeCheck_Default",
|
|
},
|
|
},
|
|
},
|
|
MSDefaults = {
|
|
flags = { "ExtraWarnings", "VS_EnableFunctionLevelLinking_No", iif(vsver ~= "9", "VS_MultiProcessorCompilation_Yes"), "VS_EnableStringPooling_Yes" }
|
|
}
|
|
}
|
|
|
|
function MSSolution:GenerateConfigurations()
|
|
Solution.GenerateConfigurations(self)
|
|
for name, options in pairs(self.msconfigurations) do
|
|
self:GenerateConfiguration(name, options)
|
|
end
|
|
self:GenerateConfiguration("*", self.MSDefaults)
|
|
end
|