You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed a file generation bug where bin2cpp_unittest would start compiling before the the end of the generation script. This would create compilation failures since some required files were not generated yet.
# The script generates multiple files from a single command, but if I try to list all of them as OUTPUT of the add_custom_command it won't work.
215
+
# CMake assumes each output is independently produced, so it starts compiling as soon as any one is generated, not necessarily all.
216
+
#
217
+
# CMake tracks outputs individually, so even if I have `OUTPUT ${GENERATED_TEST_FILES}`, it sees each output as possibly ready at different times.
218
+
# When one appears on disk (even partially), it may trigger compilation of bin2cpp_unittest, before the script finishes generating all files.
219
+
#
220
+
# To work around this behavior, is using a stamp file which is created after the generation script has run which indicates to CMake we are ready to compile bin2cpp_unittest.
221
+
# Required steps:
222
+
# Only the stamp file is listed as OUTPUT. This prevents CMake from checking each generated file independently.
223
+
# The actual source files are listed as BYPRODUCTS, so CMake knows they will appear but doesn't rely on their timestamps individually.
224
+
# add_dependencies() ensures the executable only starts compiling after the stamp file is created, i.e., after the script finishes.
225
+
#
226
+
# To force CMake to regenerate the files, delete the stamp file.
0 commit comments