Adjusted string length limits to build on VS2003
This commit is contained in:
parent
bbf7bbef3a
commit
ba8750bf28
13
premake4.lua
13
premake4.lua
@ -2,19 +2,6 @@
|
||||
-- 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
|
||||
-- default when folks build using the makefile. That way they don't have to
|
||||
|
@ -47,17 +47,23 @@
|
||||
|
||||
local function writefile(out, fname, contents)
|
||||
-- cut smaller than max, so I don't wind up with tiny strings at end of files
|
||||
local cut = 8192
|
||||
local max = 9216
|
||||
local max = 2048
|
||||
|
||||
-- break up large strings to fit in Visual Studio's string length limit
|
||||
local start = 1
|
||||
local len = contents:len()
|
||||
while start <= len do
|
||||
local n = len - start
|
||||
if n > max then n = cut end
|
||||
writeline(out, contents:sub(start, start + n))
|
||||
start = start + n + 1
|
||||
if n > max then n = max end
|
||||
local finish = start + n
|
||||
|
||||
-- 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
|
||||
|
||||
writeline(out, "EOF:" .. fname)
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user