summaryrefslogtreecommitdiff
path: root/.gitattributes
diff options
context:
space:
mode:
authorJunghyun Kim <jh0822.kim@samsung.com>2016-08-05 07:28:18 +0900
committerSoonKyu Park <sk7.park@samsung.com>2018-04-03 11:28:16 +0900
commit814fe929db909dafdd28e81d4fade1bd4005e3fc (patch)
tree21aac3450f9f77faafa225ae83d2f049bffd8d59 /.gitattributes
parentea9b66c926d0c3654d9fec12b009414a7108e80a (diff)
downloadcmake-814fe929db909dafdd28e81d4fade1bd4005e3fc.tar.gz
cmake-814fe929db909dafdd28e81d4fade1bd4005e3fc.tar.bz2
cmake-814fe929db909dafdd28e81d4fade1bd4005e3fc.zip
List of files are sorted when using aux_source_directory() and file(glob).
If aux_source_directory(. SRCS) or file(glob SRCS "*.c") is used, files in SRCS are not sorted. This can cause different orders of files across machines. Even though it does not have any correctness issue, there is a problem. If we have a build infrastructure (e.g., OBS), the result binaries can be different on each machine. In this case, build results can be different on two different machines even if we have the same source files. For example, 1. ld -o liba.a a.o b.o SRCS=a.c b.c 2. ld -o libb.a b.o a.o SRCS=b.c a.c Then, liba.a and libb.a are different. REASON This is because of the system call readdir(). The system call readdir() returns a file in the directory in any order. SOLUTION Intead of readdir(), scandir() is used with alphasort(). This makes the list of files are sorted alphabetically. AMENDED 1. another free() is added to free malloc()ed objects (Reviewed by Chan Lee). 2. remove "#include <errno.h>" (Reviewed by Chan Lee). Change-Id: Id8aff23b2761ea04c1c49c91fcc511b9bc2b1228 Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions