From dc90259bb67126a6f3e016db2a67499945d6224f Mon Sep 17 00:00:00 2001 From: StefanBruens Date: Sat, 8 Sep 2018 03:45:39 +0200 Subject: Order resources not only on filename but also dirname Although the resource generation sorted files for each subdirectory, total order, i.e. including subdirectories, was not stable. As a result, the generated resources.cpp could be different on each build run. Fixes #6152 --- src/res2cc_cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/res2cc_cmd.py b/src/res2cc_cmd.py index 7e0322d..86d999d 100755 --- a/src/res2cc_cmd.py +++ b/src/res2cc_cmd.py @@ -98,10 +98,11 @@ def main(): directory = sys.argv[1] files = [] for dirName, subdirList, fileList in walk(directory): - for fname in sorted(fileList): + for fname in fileList: subdir = dirName[len(directory)+1:] if dirName.startswith(directory) else dirName if subdir: files.append(File.factory(directory,subdir,fname)) + files.sort(key=lambda f: f.subdir + "/" + f.fileName) outputFile = open(sys.argv[2],"w") print("#include \"resourcemgr.h\"\n",file=outputFile) for f in files: -- cgit v0.12