Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bernhard M. Wiedemann
CMake
Commits
e7f709eb
Commit
e7f709eb
authored
Jun 02, 2017
by
Bernhard M. Wiedemann
Browse files
Sort file lists
to enable more reproducible builds without patching individual build definitions
parent
c095e90f
Pipeline
#61032
passed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Help/release/dev/sorted-glob.rst
0 → 100644
View file @
e7f709eb
sorted glob
-----------
* calls like `file(GLOB SOMEVARIABLE "*.c")`
will now return sorted results on POSIX-compliant platforms
to avoid builds that order functions in output files depending on
random filesystem order
Source/kwsys/Directory.cxx
View file @
e7f709eb
...
...
@@ -201,17 +201,21 @@ bool Directory::Load(const std::string& name)
{
this
->
Clear
();
DIR
*
dir
=
opendir
(
name
.
c_str
());
kwsys_dirent
**
namelist
;
int
n
;
n
=
scandir
(
name
.
c_str
(),
&
namelist
,
NULL
,
alphasort
);
if
(
!
dir
)
{
if
(
n
==
-
1
)
{
return
0
;
}
for
(
kwsys_dirent
*
d
=
readdir
(
dir
);
d
;
d
=
readdir
(
dir
))
{
while
(
n
--
)
{
kwsys_dirent
*
d
=
namelist
[
n
];
this
->
Internal
->
Files
.
push_back
(
d
->
d_name
);
free
(
d
);
}
this
->
Internal
->
Path
=
name
;
closedir
(
dir
);
free
(
namelist
);
return
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment