diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake index cb92d66fd9..f6138927e5 100644 --- a/extras/Build/CMake/JUCEUtils.cmake +++ b/extras/Build/CMake/JUCEUtils.cmake @@ -862,11 +862,20 @@ function(juce_add_binary_data target) list(APPEND binary_file_names "${juce_binary_data_folder}/${JUCE_ARG_HEADER_NAME}") + set(newline_delimited_input) + + foreach(name IN LISTS JUCE_ARG_SOURCES) + set(newline_delimited_input "${newline_delimited_input}${name}\n") + endforeach() + + set(input_file_list "${juce_binary_data_folder}/input_file_list") + file(WRITE "${input_file_list}" "${newline_delimited_input}") + add_custom_command(OUTPUT ${binary_file_names} COMMAND juce::juceaide binarydata "${JUCE_ARG_NAMESPACE}" "${JUCE_ARG_HEADER_NAME}" - ${juce_binary_data_folder} ${JUCE_ARG_SOURCES} + ${juce_binary_data_folder} "${input_file_list}" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - DEPENDS ${JUCE_ARG_SOURCES} + DEPENDS "${input_file_list}" VERBATIM) target_sources(${target} PRIVATE "${binary_file_names}") diff --git a/extras/Build/juceaide/Main.cpp b/extras/Build/juceaide/Main.cpp index 25b4efc50f..a88a4a2650 100644 --- a/extras/Build/juceaide/Main.cpp +++ b/extras/Build/juceaide/Main.cpp @@ -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,