1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-15 16:39:26 +08:00

128 Commits

Author SHA1 Message Date
Brad King
df6b077625 cmake: Remove broken '--warn-unused-vars' option
This option has been broken since commit b9f9915516 (cmMakefile: Remove
VarUsageStack., 2015-05-17, v3.3.0-rc1~52^2).  That commit removed the
check that an initialized variable has actually been used and caused the
option to warn on every variable ever set.  This was not caught by the
test suite because the test for the feature only checked that warnings
appear when needed and not that they do not appear when not needed.

The option was never very practical to use.  Remove it to avoid the
runtime cost of usage tracking and checks for every variable (which we
were doing even when the option was not used).
2020-06-29 17:23:27 -04:00
Vitaly Stakhovsky
b36d1bdd9d Single location for cmProp typedef 2020-06-01 08:54:20 -04:00
Vitaly Stakhovsky
d606b19f7d server-mode: Fix regression in cache entry reporting
Refactoring in commit 0bf0e35e59 (cmCacheManager::GetProperty: return
cmProp, 2020-03-19) changed the return type of GetCacheEntryValue.
Update the server mode's call site accordingly.
2020-05-28 06:46:10 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Vitaly Stakhovsky
e267c3fddf cmState::GetInitializedCacheValue: return cmProp
cmProp alias is used; no actual change in type
2020-04-30 10:45:45 -04:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Vitaly Stakhovsky
a7f2ff16a4 cmState::GetCacheEntryProperty: return cmProp 2020-03-25 14:46:52 -04:00
Vitaly Stakhovsky
bd89133543 cmState::GetCacheEntryValue: return cmProp 2020-03-17 12:09:20 -04:00
Marc Chevrier
a00960288b GlobalGenerator family: modernize memory management 2020-01-07 11:03:11 +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
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00
Regina Pfeifer
d63c1e4e6e clang-tidy: modernize-return-braced-init-list 2019-09-06 22:27:39 +02:00
Regina Pfeifer
2dfc52675c cmAlgorithms: Add cmContains
Also, use the new function where applicable.
2019-08-19 20:01:39 +02:00
Regina Pfeifer
4af094c8df clang-tidy: Blacklist violations for version 8
Check the codebase with clang-tidy version 8, fix the low hanging
fruits, blacklist the rest.
2019-07-30 12:38:30 +02:00
Marc Chevrier
d9b2c7dae2 Introduce memory management helper: cm_memory.hxx 2019-07-14 15:37:30 +02:00
Brad King
6696855f72 cmake: Simplify implementation of -E capabilities
The `cmake -E capabilities` command-line tool is implemented only in a
full-featured (non-bootstrap) CMake, and server mode is now always
available in this case.
2019-06-07 11:08:38 -04:00
Brad King
996e1885c4 server: deprecate in favor of the file-api
Document the server mode as deprecated.  Add a deprecation message
to the configure step output when invoked through server mode.

Closes: #19101
2019-04-22 09:38:44 -04:00
Gregor Jasny
1c6c2bae28 cmake-server: Normalize build and source directories
Fixes: #18862
2019-01-31 12:49:56 -05:00
Regina Pfeifer
5a0784ddea clang-tidy: Pass by value 2019-01-22 13:03:04 -05:00
Kyle Edwards
4568d046c4 Properties: Add CMAKE_ROLE global property
This property allows scripts to determine whether they're in project
mode, script mode, find-package mode, CTest, or CPack.
2019-01-17 09:44:29 -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
b48165346f server: Split json dictionary into separate header
Move dictionary entries used by the json object generation code into a
separate header.  These are distinct from the server-only entries used
in the protocol implementation.
2018-09-21 11:39:21 -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
Brad King
aabce52851 server: factor out json object generation entry points
Make entry points for these that do not reference the server code.  For
now we leave the "cache" object generation alone because its
implementation interleaves error handling and the format may not
suitable outside a server response.
2018-09-21 11:36:55 -04:00
Brad King
708b3fecfe Merge topic 'gicv-stdstring'
13d10ee616 cmState::GetInitializedCacheValue: Return as const std::string*

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2365
2018-09-12 09:38:37 -04:00
Vitaly Stakhovsky
13d10ee616 cmState::GetInitializedCacheValue: Return as const std::string* 2018-09-10 09:31:48 -04:00
Brad King
1b57f49586 genex: Simplify cmGeneratorExpressionInterpreter
All callers were constructing with a non-empty target name using the
target whose pointer was passed anyway.  Drop this argument.  Simplify
logic accordingly.  Re-order constructor arguments to match the
cmCompiledGeneratorExpression::Evaluate arguments.

Also remove unnecessary getters.
2018-09-07 09:23:43 -04:00
Brad King
69ce062969 Merge topic 'cmakeServerSourcesForInterfaceLibraries'
d74c2282ea cmake-server: Support codemodel filegroups for INTERFACE_SOURCES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Tobias Hunger <tobias.hunger@gmail.com>
Acked-by: Markus Enzenberger <markus.enzenberger@gmail.com>
Merge-request: !2282
2018-09-04 09:57:58 -04:00
Justin Goshi
d74c2282ea cmake-server: Support codemodel filegroups for INTERFACE_SOURCES
This change returns information for INTERFACE_SOURCES. We add
a flag to the filegroup to indicate if the target represents
interface sources.

Protocol version is updated to 1.3 since this is a change to what was
released in cmake version 3.12.
2018-08-30 16:09:22 -07:00
Brad King
d879999534 Merge topic 'genex-evaluate-stdstring'
65ab9ce938 Genex: Return Evaluate results as const std::string&

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2314
2018-08-30 09:18:58 -04:00
Vitaly Stakhovsky
65ab9ce938 Genex: Return Evaluate results as const std::string&
Also remove unused overloads.
2018-08-28 13:56:29 -04:00
Vitaly Stakhovsky
c8fd23ec6f cmMakefile: return directories as const std::string& 2018-08-27 14:07:43 -04:00
Vitaly Stakhovsky
c530e2f74f cmCompiledGeneratorExpression::Evaluate(): return const std::string& 2018-08-09 14:50:17 -04:00
Brad King
aefb8559dc IWYU: Fix workaround mapping for std::hash
It is provided by `functional`, not `utility`.  Fix the mapping added by
commit 276d3c7afe (IWYU: Add workaround mapping for std::hash,
2018-07-31).  Also generalize the workaround from commit v3.12.0-rc1~39^2~1
(IWYU: Define a macro to tell code it is preprocessing for iwyu,
2018-05-25) to allow local builds to configure specific flags.  This
is needed because iwyu behaves differently in different environments.
2018-08-07 12:04:58 -04:00
Brad King
276d3c7afe IWYU: Add workaround mapping for std::hash
When using GCC 8's standard library IWYU thinks that `<system_error>`
must be included to get `std::hash`.  Add a mapping for `<utility>`.
2018-07-31 09:34:55 -04:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* 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.
2018-06-01 09:53:42 -04:00
Brad King
2deb9b7f34 Genex: Fix COMPILE_LANGUAGE in SYSTEM include directories
When evaluating `INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`, or evaluating
`INTERFACE_INCLUDE_DIRECTORIES` on an imported target, thread the
compile language through to the generator expression evaluator so
that it can support `$<COMPILE_LANGUAGE:...>`.

Fixes: #17811
2018-03-12 11:45:01 -04:00
Pavel Solodovnikov
653b894683 Reduce raw string pointers usage.
* Change some functions to take `std::string` instead of
  `const char*` in the following classes: `cmMakeFile`, `cmake`,
  `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
  and a few others.
* Greatly reduce using of `const char*` overloads for
  `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
* Remove many redundant `c_str()` conversions throughout the code.
2018-01-31 18:23:03 +03:00
Pavel Solodovnikov
c85bb007df Reduce allocation of temporary values on heap.
- Use `std::move` while inserting temporary results into vectors.
- Change `push_back` to `emplace_back` where appropriate.
2018-01-26 13:24:45 +03:00
Brad King
5c724c4ca8 Merge topic 'server-polish-opt-handshake'
239a3ef8 Server-mode: Document protocol version for optional handshake arguments
9b1a3d24 Server-mode: Rename functions to reflect what they do

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1693
2018-01-25 08:35:28 -05:00
Tobias Hunger
9b1a3d244b Server-mode: Rename functions to reflect what they do
Rename the test* static functions to getOrTest* to better reflect
what they do now.
2018-01-24 17:01:40 +01:00
Marc Chevrier
0448311179 sourceFile properties: add property INCLUDE_DIRECTORIES 2018-01-24 15:10:10 +01:00
Marc Chevrier
78b1c2e09e sourceFile properties: add property COMPILE_OPTIONS
Add the support of per-source property COMPILE_OPTIONS,
including generator expressions support.

Related: #17507
2018-01-23 10:24:56 +01:00
Justin Goshi
33802b3168 server: fix crash if no min version specified
If a CMakeLists.txt file doesn't contain cmake_minimum_required then the
server was crashing. The root cause was the json object model does not
support null and was crashing. Add the null check and use an empty
string in this case.
2018-01-18 20:54:02 -08:00
Justin Goshi
2c1ecab64d server: Expand generator expressions for test info 2018-01-03 16:49:00 -08:00
Marc Chevrier
10f58b27ac Genex: Per-source $<COMPILE_LANGUAGE:...> support
Fixes: #17542
2017-12-13 16:35:22 +01:00
Brad King
b7100756d7 Merge branch 'backport-revert-server-target-backtraces' into revert-server-target-backtraces 2017-12-06 11:49:52 -05:00
Brad King
976370d134 server: drop "ctestInfo" backtrace information
Backtrace information was included by commit 35a52bd1b4 (server: add
"ctestInfo" request to get test info, 2017-10-25) to match that already
provided for targets.  However, the backtrace representation uses too
much memory and needs to be dropped.  Remove it from test information.

Issue: #17502
2017-12-06 11:45:51 -05:00