Adjusted string length limits to build on VS2003

This commit is contained in:
starkos 2010-01-07 16:24:17 +00:00
parent bbf7bbef3a
commit ba8750bf28
3 changed files with 80 additions and 41 deletions

View File

@ -2,19 +2,6 @@
-- Premake 4.x build configuration script -- Premake 4.x build configuration script
-- --
--
-- Earlier versions of Visual Studio limit static strings to 1K (IIRC) and choke on
-- the embedded scripts. I'll work around it if people complain.
--
if (_ACTION == "vs2002" or _ACTION == "vs2003") then
error(
"\nBecause of compiler limitations, Visual Studio 2002 and 2003 aren't able to\n" ..
"build this version of Premake. Use the free Visual Studio Express instead.", 0)
end
-- --
-- Define the project. Put the release configuration first so it will be the -- Define the project. Put the release configuration first so it will be the
-- default when folks build using the makefile. That way they don't have to -- default when folks build using the makefile. That way they don't have to

View File

@ -47,17 +47,23 @@
local function writefile(out, fname, contents) local function writefile(out, fname, contents)
-- cut smaller than max, so I don't wind up with tiny strings at end of files -- cut smaller than max, so I don't wind up with tiny strings at end of files
local cut = 8192 local max = 2048
local max = 9216
-- break up large strings to fit in Visual Studio's string length limit -- break up large strings to fit in Visual Studio's string length limit
local start = 1 local start = 1
local len = contents:len() local len = contents:len()
while start <= len do while start <= len do
local n = len - start local n = len - start
if n > max then n = cut end if n > max then n = max end
writeline(out, contents:sub(start, start + n)) local finish = start + n
start = start + n + 1
-- make sure I don't cut an escape sequence
while contents:sub(finish, finish) == "\\" do
finish = finish - 1
end
writeline(out, contents:sub(start, finish))
start = finish + 1
end end
writeline(out, "EOF:" .. fname) writeline(out, "EOF:" .. fname)

File diff suppressed because one or more lines are too long