Use clang-tidy's performance-unnecessary-copy-initialization checker.
After applying the fix-its (which turns the copies into const&), revise
the changes and see whether the copies can be removed entirely by using
the original instead.
Use clang-tidy's performance-unnecessary-value-param checker to find
value parameter declarations of expensive to copy types that are not
modified inside the function. Ignore findings in kwsys.
After applying the fix-its, manually change `const T&` to `T const&`.
d256ba07 try_compile: Optionally forward custom platform variables to test project
fb4791b3 cmCoreTryCompile: Refactor forwarding of variables to test project
Add a `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify a list
of custom variables to be forwarded to a `try_compile` test project.
This will be useful for platform information modules or toolchain files
to forward some platform-specific set of variables from the host project
(perhaps set in its cache) to the test project so that it can build the
same way.
De-duplicate the logic that constructs the cmake `-D` flag used to pass
variables into the test project cache. Also subsume variables that were
propagated by generating `set()` commands in the project and pass them
as cache entries instead.
5784747d Improve string find: prefer character overloads.
5cec953e Use std::replace for replacing chars in strings.
2a1a2033 cmExtraEclipseCDT4Generator: use std::replace.
34bc6e1f cmCTestScriptHandler: don't call find repeatedly.
c1340827 Add a variable to specify language-wide system include directories
44199097 cmMakefile: Optimize AddSystemIncludeDirectories for empty set
a896043b GHS: Compute include directories consistently with other generators
Create a `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable to specify
system include directories for for `<LANG>` compiler command lines.
This plays a role for include directories as the existing
`CMAKE_<LANG>_STANDARD_LIBRARIES` variable does for link libraries.
This patch preserves backward compatibility of
deb package names with previous CMake versions
but similarly to CPack/RPM allows to change
package name format and supports DEB-DEFAULT
setting that produces proper Debian package names.
eb076692 Tests: Select RunCMake.Ninja test cases based on ninja version
8a862a4d Ninja: Support embedding of CMake as subninja project
038e7716 Ninja: Pass all build paths through a central method
7c26a6a2 Ninja: Fix path to soname-d target file
ac3cdd9a Ninja: Convert object file names to ninja paths earlier
d4381cb1 Ninja: Convert link library file names like all other output paths
0397c92a Ninja: Pre-compute "CMakeCache.txt" build target name
3b3ecdfa Ninja: Pre-compute "all" build target name
5ca72750 Ninja: Simplify generation of custom target logical path
Manually extract the C++ portion of `cmListFileLexer.in.l` into a
temporary file, format it, and then move it back into the original file.
Manually format C++ code inside the lexer actions to match our style.
Then re-generate the lexer.
Revise the documented modifications we need to make to the
flex-generated source file according to the needs of the new version.
Update our own implementation to avoid warnings with flex types.
Even though the `file(GLOB)` documentation specifically warns against
using it to collect a list of source files, projects often do it anyway.
Since it uses `readdir()`, the list of files will be unsorted.
This list is often passed directly to add_executable / add_library.
Linking binaries with an unsorted list will make it unreproducible,
which means that the produced binary will differ depending on the
unpredictable `readdir()` order.
To solve those reproducibility issues in a lot of programs (which don't
explicitly `list(SORT)` the list manually), sort the resulting list of
the `file(GLOB)` command.
A more detailed rationale about reproducible builds is available
[here](https://reproducible-builds.org/).
Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable. When it is set, CMake
generates a `build.ninja` file suitable for embedding into another ninja
project potentially generated by an alien generator.
In WriteObjectBuildStatement we pass object file names and directories
to several places that expect paths as Ninja sees them. Convert them to
Ninja paths before all such uses.
All paths generated on Ninja-invoked command lines should be passed
through ConvertToNinjaPath. Fix ConvertToLinkReference to call this
instead of partially duplicating its implementation.
In `AppendTargetOutputs` we generate a logical build target name for
each UTILITY command. Simplify the logic to avoid testing the result
of `ConvertToNinjaPath`.
d9fd2f54 Revise C++ coding style using clang-format
82df6dea Empty commit at end of history preceding clang-format style transition
6a13f43f CONTRIBUTING: Add a section on coding style
bf451d9f Add a script to run clang-format on the entire source tree
1e90d78f Configure clang-format for CMake source tree
da60adc3 Tell Git to use a distinct conflict marker size in `.rst` files
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.
The `IMPLEMENT_VISIT_IMPL` macro must preserve a space before the `>`
character in case the `DATATYPE` is a template type ending in `>`.
Manually format the macro layout as clang-format would except for this
space. Then add markup to tell clang-format not to format this macro.
Packagers may now set their own rpm package
file names or request that rpmbuild tool
chooses one for them. It also supports handing
of situations where one spec file may produce
multiple rpm packages.
The empty string we add as a link item for an INTERFACE_LIBRARY target
is not a path, so do not mark it as such. The generators currently
tolerate it either way, but only by accident.
Set LC_NUMERIC = "C" at startup after Qt initializes the application
because Qt may have adopted the current locale from the environment.
CMake does not define behavior for non-C-locale numeric behavior.
Since commit v3.3.0-rc1~430^2 (Teach find_(library|file|path) to get
prefixes from PATH, 2015-02-18) we search in <prefix>/include and
<prefix>/lib directories for prefixes with bin directories in the PATH
environment variable. The motivation was to support MSYS, MinGW and
similar Windows platforms in their default environments automatically.
At the time this behavior was thought to be worthwhile in general.
Suggested-by: Chuck Atkins <chuck.atkins@kitware.com>