| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
When `std::cout` and `FILE *stdout` are used at same time need to
explicitly flush otherwise they can be out of sync.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool. Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience. Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.
Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices. It also references version control
history for more precise information. Therefore we no longer need to spell
out the list of Contributors in each source file notice.
Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing". The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.
Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically. Manually fix up shebang lines and trailing
newlines in a few files. Manually update the notices in a few files that the
script does not handle.
|
|\
| |
| |
| |
| |
| | |
88494325 Tests: Add test for our strverscmp implementation
07f69bd5 cmSystemTools: Add strverscmp
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for natural string order by comparing non-numerical
character directly and numerical number by firstly collecting contiguous
digits. The order is defined by the `strverscmp(3)` manual [1].
[1] http://man7.org/linux/man-pages/man3/strverscmp.3.html
Inspired-by: Pierluigi Taddei <pierluigi.taddei@gmail.com>
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION
equivalents to use the combined <= and >= functionality.
|
| |
|
| |
|
|
|
|
|
| |
Apply fixits of clang-tidy's readability-braces-around-statements
checker.
|
|\
| |
| |
| |
| | |
c6220de2 Use the empty() method to check for emptyness.
|
| |
| |
| |
| |
| | |
Apply fix-its from clang-tidy's readability-container-size-empty
checker.
|
|\ \
| |/
|/|
| |
| | |
7f6b8d33 Simplify boolean expressions
|
| |
| |
| |
| |
| |
| | |
Use clang-tidy's readability-simplify-boolean-expr checker.
After applying the fix-its, revise all changes *very* carefully.
Be aware of false positives and invalid changes.
|
|/
|
|
|
| |
Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration.
Add a `--bindir` option to the `bootstrap` script to set it.
|
|\
| |
| |
| |
| | |
8e801eb5 cmSystemTools: Fix indentation typo
|
| | |
|
|/
|
|
|
| |
Apply fix-its from clang-tidy's performance-faster-string-find checker.
Ignore findings in kwsys.
|
|
|
|
|
| |
Avoid using a KWSys RegularExpression to search for RPATH substrings.
It cannot handle large expressions.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
Use the following command to automate the change:
$ git ls-files -z -- \
"*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
egrep -z -v "^Source/cmCommandArgumentLexer\." |
egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmDependsJavaLexer\." |
egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmExprLexer\." |
egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmFortranLexer\." |
egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
egrep -z -v "^Source/cmListFileLexer\." |
egrep -z -v "^Source/cm_sha2" |
egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
egrep -z -v "^Utilities/(KW|cm).*/" |
xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'
This avoids modifying third-party sources and generated sources.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The clang-format tool can do a good job formatting most code, but
well-organized streaming blocks are best left manually formatted.
Find blocks of the form
os <<
"...\n"
"...\n"
;
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}'
Find blocks of the form
os << "...\n"
<< "...\n"
<< "...\n";
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}'
Surround such blocks with the pair
/* clang-format off */
...
/* clang-format on */
in order to protect them from update by clang-format. Use the C-style
`/*...*/` comments instead of C++-style `//...` comments in order to
prevent them from ever being swallowed by re-formatting of surrounding
comments.
|
|
|
|
|
| |
When this header is included in blocks where order does not matter, just
place it in lexicographic order as clang-format would by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sort include directives within each block (separated by a blank line) in
lexicographic order (except to prioritize `sys/types.h` first). First
run `clang-format` with the config file:
---
SortIncludes: false
...
Commit the result temporarily. Then run `clang-format` again with:
---
SortIncludes: true
IncludeCategories:
- Regex: 'sys/types.h'
Priority: -1
...
Commit the result temporarily. Start a new branch and cherry-pick the
second commit. Manually resolve conflicts to preserve indentation of
re-ordered includes. This cleans up the include ordering without
changing any other style.
Use the following command to run `clang-format`:
$ git ls-files -z -- \
'*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
egrep -z -v '^Source/cm_sha2' |
egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
egrep -z -v '^Utilities/(KW|cm).*/' |
egrep -z -v '^Tests/Module/GenerateExportHeader' |
egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
xargs -0 clang-format -i
This selects source files that do not come from a third-party.
Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
|
|
|
|
|
| |
Each source file has a logical first include file. Include it in an
isolated block so that tools that sort includes do not move them.
|
|
|
|
| |
Read `/dev/urandom` without buffering to avoid taking more than we need.
|
|
|
|
|
| |
We do not seem to need this header anymore, and including it on AIX
causes `#define open open64` which breaks `std::ifstream::open` calls.
|
|
|
|
|
|
|
|
|
| |
Audit the code to make sure there are no callers that use OUTPUT_MERGE
with separate capture strings. Then change RunSingleCommand to
implement output merging by giving the child process a single pipe for
both its stdout and stderr descriptors. This will more cleanly merge
the content on atomic write boundaries in the child instead of on
arbitrary buffering boundaries in the parent.
|
|
|
|
|
|
| |
Assign to the result strings instead setting to empty and appending.
The old approach was left from when we directly buffered output in
the strings.
|
|
|
|
|
| |
The output processing loop is already guarded by a condition so we do
not need to repeat the condition inside the loop.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some compilers may add their own RPATH entries when invoking the linker.
For example, a GCC installation may contain the following definition in
the specs file:
*link_libgcc:
%D -rpath <<some specific rpath in which libstdc++.so can be found>>
In this case binaries may contain RPATH entries that CMake did not add.
When we update the RPATH on installation we must preserve these entries
even if CMake thinks the INSTALL_RPATH value should be empty.
Fix this by always using file(RPATH_CHANGE) and teach it to behave as
file(RPATH_REMOVE) if the actual RPATH in the file is empty after
replacing the build-tree RPATH with the install-tree RPATH. This will
preserve any compiler-added RPATH value instead of removing it.
|
|\
| |
| |
| |
| |
| |
| | |
a57caf7e VS: Fix Windows 10 SDK version selection (#15831)
ad594de8 cmSystemTools: Add VersionCompareEqual helper
c173e37f VS: Do not select a partial Windows 10 SDK folder (#15831)
|
| |
| |
| |
| | |
Wrap a call to VersionCompare with OP_EQUAL.
|
|/ |
|
|
|
|
|
| |
Wrap a call to VersionCompare with OP_GREATER in a signature suitable
for use with std::sort.
|
|
|
|
|
| |
On windows FILE_FLAG_BACKUP_SEMANTICS enables us to
read/write time both on files and directories.
|
|
|
|
|
|
| |
On Windows if file permissions are read only
FILE_WRITE_ATTRIBUTES will enables us to
get file handle and change file time.
|
|
|
|
|
|
|
|
|
| |
The changes in commit 47b060ae (CPackDeb: allow empty directories in
component packages, 2015-09-21), commit b58de9fe (CPack: allow packaging
of empty directories, 2015-09-21), and commit b761e90d (CPack: remove
accidental changes, 2015-09-22) regressed packaging of CMake itself.
Revert the changes until they can be revised and rebased on other
changes that make additional fixes.
|
| |
|
|
|
|
|
| |
This executable comes with CMake so just compute its location in
cmSystemTools instead of storing it in compiler information modules.
|
|
|
|
|
|
|
|
| |
Since commit v2.8.11~59^2 (cmSystemTools: Generalize TrimWhitespace to
all whitespace, 2013-03-27) we incorrectly use `c <= ' '` to determine
if `c` is a whitespace character. With a signed `char` type UTF-8
encoded strings may be truncated because values above 0x7f appear
negative and therefore less than 0x20. Use `isspace(c)` instead.
|
|
|
|
|
|
| |
Extract the logic added by commit v3.1.0-rc1~386^2 (Encoding: Fix debug
asserts ... with non-ascii chars, 2014-06-16) into a helper function so
we can re-use it.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
8ea7611b find_program: Optionally consider all names in each directory
fc1990c9 cmFindProgramCommand: Re-implement search using more flexible approach
fdbfc9f6 Tests: Add explicit testing for find_program
907a919b cmSystemTools: Drop unused StringEndsWith method
ed4de3c9 cmFindProgramCommand: Use Names member instead of passing it
bf32b95e cmFindLibraryCommand: Avoid repeating search for the same name
|
| |
| |
| |
| | |
It has no callers and we can inherit one from KWSys SystemTools anyway.
|
|\ \
| |/
|/|
| |
| | |
7c33b0f9 cmSystemTools: Skip ComputeCertificateThumbprint during bootstrap
|