26 Commits

Author SHA1 Message Date
Vitaly Stakhovsky
e64fa5f1b6 cmSourceFile::GetProperty: return cmProp 2020-04-14 10:57:17 -04:00
Rolf Eike Beer
48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() 2020-03-23 22:41:43 +01:00
Marc Chevrier
f466cea3c9 cmMakefile: modernize memory management 2020-01-14 11:03:07 +01:00
Marc Chevrier
5444a8095d cmGlobalGenerator: modernize memrory managemenbt 2019-12-30 16:55:39 +01:00
Marc Chevrier
f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Daniel Eiband
7dcf9cb83c cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utility
cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is
needed or an instance of cmCompiledGeneratorExpression cannot be cached.

Fixes: #19686
2019-09-23 21:19:15 +02:00
Daniel Eiband
2d888e3390 cmSourceFile: Rename mutating GetFullPath() overload
Rename mutating GetFullPath() overload to ResolveFullPath().
2019-08-29 22:51:58 +02:00
Tushar Maheshwari
8cb3cffa42 cmSourceFile: Rename non-const GetLanguage
GetOrDetermineLanguage:
- Read the property if available
- Determine the Language using the file extension

Fix all usage of the non-const member in the repository.
2019-08-27 21:35:42 +05:30
Brad King
bbf4a5771f Merge topic 'tidy_inefficient_string'
18b0330b86 clang-tidy: Enable performance-inefficient-string-concatenation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3648
2019-08-07 11:54:53 -04:00
Sebastian Holtermann
18b0330b86 clang-tidy: Enable performance-inefficient-string-concatenation
Enables the clang-tidy test performance-inefficient-string-concatenation
and replaces all inefficient string concatenations with `cmStrCat`.

Closes: #19555
2019-08-05 17:21:00 +02:00
Sebastian Holtermann
7fbcc16dcd cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenize
This adds the following functions to `cmStringAlgorithms`:

- `cmIsSpace`
- `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`)
- `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`)
- `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to
  accept `cm::string_view`)
2019-08-05 11:25:30 +02:00
Brad King
22d3eb5d5e Refactor checks for whether a target has an import library
Use `HasImportLibrary` for such checks.
2019-07-12 17:29:40 -04:00
Brad King
71fbebd1dc IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints.  Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
2019-07-10 11:48:56 -04:00
Sebastian Holtermann
e0a8ff3148 cmPropertyMap: Use std::string as value container class 2019-06-08 12:25:35 +02:00
Sebastian Holtermann
026f65d284 cmPropertyMap: Add GetList method 2019-06-08 12:25:35 +02:00
Sebastian Holtermann
006229278b Use cmAppend to append ranges to std::vector instances 2019-05-23 16:19:49 +02:00
Sebastian Holtermann
6d407ae439 Use cmSourceFile::GetIsGenerated 2019-02-01 17:02:53 +01:00
Sebastian Holtermann
f16dfdf71f cmLocalGenerator: Simplify GetIncludeDirectories
This patch strips the `stripImplicitDirs` and `appendAllImplicitDirs`
parameters from the `cmLocalGenerator::GetIncludeDirectories` method and makes
it a wrapper into the new `cmLocalGenerator::GetIncludeDirectoriesImplicit`
method.  `cmLocalGenerator::GetIncludeDirectoriesImplicit` is the renamed old
implementation of `cmLocalGenerator::GetIncludeDirectories` and still
accepts `stripImplicitDirs` and `appendAllImplicitDirs`.

The motivation is that there's only *one* case where
`cmLocalGenerator::GetIncludeDirectories` is called with the
`stripImplicitDirs` parameter being `false` (QtAutoGen), but many other places
where it is called using the `true` default value.

QtAutoGen is modified to use `cmLocalGenerator::GetIncludeDirectoriesImplicit`
directly.  In two use cases of `cmLocalGenerator::GetIncludeDirectories`
the manually set `true` value for `stripImplicitDirs` is removed.
2019-01-28 08:41:28 -05:00
Regina Pfeifer
ef61997b1b clang-tidy: Use emplace 2019-01-17 13:12:02 -05:00
Brad King
cd0881be61 IWYU: Update CMake code for IWYU built with Clang 6
IWYU now correctly requires `<utility>` for `std::move`.  It also
requires a container header when used via a range-based for loop.
2019-01-15 10:00:50 -05:00
Kyle Edwards
c150bf087c Server mode: Fix regression of hasInstallRule
The introduction of policy CMP0082, to run subdirectory install
rules in the correct order, caused a regression in server mode
where any directory with a subdirectory is marked as having an
install rule even if no "real" install rules are present. This
change fixes this regression for server mode.
2018-12-12 10:29:50 -05:00
Regina Pfeifer
3e60580784 clang-tidy: Fix readability-static-accessed-through-instance
Enable the check in .clang-tidy and fix all warnings.
2018-11-22 00:11:37 +01:00
Brad King
284a38e42f cmake-server: Revert "Support codemodel filegroups for INTERFACE_SOURCES"
Revert commit v3.13.0-rc1~144^2 (cmake-server: Support codemodel
filegroups for INTERFACE_SOURCES, 2018-08-10).  The changes activate
code paths not meant to be used with interface libraries.  Another
approach will be needed to expose this information later.

This revert has to be done by hand because the code in question has been
changed somewhat since the changes were made, and was also factored out
to another source file.

Fixes: #18463
2018-10-17 14:02:39 -04:00
Brad King
72b4c2c48a server: Compile json object generation source separately
Declare entry points in a dedicated header and compile the source
separately instead of including it in the server implementation.
2018-09-21 11:39:59 -04:00
Brad King
85be67217b server: Split json object generation into separate source
For now just move the content and `#include` it back in to the original
translation unit.  That way `git blame` can cleanly track the original
lines.
2018-09-21 11:39:21 -04:00