mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
CMake: Avoid commandline length limit when creating binarydata libraries with hundreds of input files
This commit is contained in:
parent
282ad8fa9c
commit
c7d082e770
2 changed files with 22 additions and 5 deletions
|
|
@ -69,18 +69,26 @@ namespace ProjectInfo
|
|||
|
||||
int writeBinaryData (juce::ArgumentList&& args)
|
||||
{
|
||||
args.checkMinNumArguments (3);
|
||||
args.checkMinNumArguments (4);
|
||||
const auto namespaceName = args.arguments.removeAndReturn (0);
|
||||
const auto headerName = args.arguments.removeAndReturn (0);
|
||||
const auto outFolder = args.arguments.removeAndReturn (0).resolveAsExistingFolder();
|
||||
const auto inputFileList = args.arguments.removeAndReturn (0).resolveAsExistingFile();
|
||||
|
||||
juce::build_tools::ResourceFile resourceFile;
|
||||
|
||||
resourceFile.setClassName (namespaceName.text);
|
||||
const auto lineEndings = args.removeOptionIfFound ("--windows") ? "\r\n" : "\n";
|
||||
|
||||
for (const auto& arg : args.arguments)
|
||||
resourceFile.addFile (arg.resolveAsExistingFile());
|
||||
const auto allLines = [&]
|
||||
{
|
||||
auto lines = juce::StringArray::fromLines (inputFileList.loadFileAsString());
|
||||
lines.removeEmptyStrings();
|
||||
return lines;
|
||||
}();
|
||||
|
||||
for (const auto& arg : allLines)
|
||||
resourceFile.addFile (juce::File (arg));
|
||||
|
||||
const auto result = resourceFile.write (0,
|
||||
lineEndings,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue