Updated global header generator
Now adds include guards Former-commit-id: bbc67864703910cf21946fd22302efe6a52d8495
This commit is contained in:
@@ -27,6 +27,11 @@ function generateHeaders()
|
|||||||
header:write("// This file was automatically generated by Nazara\n\n")
|
header:write("// This file was automatically generated by Nazara\n\n")
|
||||||
header:write(head .. "\n")
|
header:write(head .. "\n")
|
||||||
|
|
||||||
|
-- Protection du multi-including
|
||||||
|
local preprocessorName = "NAZARA_GLOBAL_" .. string.upper(moduleName) .. "_HPP"
|
||||||
|
header:write("#ifndef " .. preprocessorName .. "\n")
|
||||||
|
header:write("#define " .. preprocessorName .. "\n\n")
|
||||||
|
|
||||||
local files = os.matchfiles(modulePath .. "/*.hpp")
|
local files = os.matchfiles(modulePath .. "/*.hpp")
|
||||||
local count = 0
|
local count = 0
|
||||||
for k, filePath in pairs(files) do
|
for k, filePath in pairs(files) do
|
||||||
@@ -40,9 +45,10 @@ function generateHeaders()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print(string.format("-# of includes: %d", count))
|
header:write("\n#endif // " .. preprocessorName .. "\n")
|
||||||
|
|
||||||
header:close()
|
header:close()
|
||||||
|
|
||||||
|
print(string.format("-# of includes: %d", count))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Reference in New Issue
Block a user