Commit Graph

49 Commits

Author SHA1 Message Date
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Marc Chevrier
557cecdc3d Modernize memory management
Update internals of various classes
2020-02-27 11:11:30 +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
Marc Chevrier
d9b2c7dae2 Introduce memory management helper: cm_memory.hxx 2019-07-14 15:37:30 +02:00
Vitaly Stakhovsky
950c099d83 cmake: Progress functions use std::string param 2019-02-11 10:32:43 -05:00
Vitaly Stakhovsky
82edd98300 cmSystemTools: MessageCallback and Message() accept std::string argument 2019-02-07 13:41:27 -05:00
Regina Pfeifer
8c92db829b MessageCallback: Remove unused bool& argument 2019-01-29 16:35:53 +01:00
Regina Pfeifer
bcee24aecc Use std::function for callbacks 2019-01-29 16:32:52 +01:00
Regina Pfeifer
414aa6c81e clang-tidy: Simplify boolean expressions 2019-01-15 11:40:25 -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
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
Justin Berger
3519c8f247 utilities: Swapped to use std C++11 mutex/threading constructs 2017-12-01 12:09:51 -07:00
Justin Berger
1e9b7d3ceb server: Switched to a auto model for handles 2017-11-29 16:36:31 -05:00
Justin Berger
f5d2988ea7 server: Swapped to cm_thread impl 2017-11-01 11:32:11 -06:00
Pavel Solodovnikov
37d9387be3 Replace empty-string comparisons with checking against empty(). 2017-09-21 11:23:19 +03:00
Justin Berger
0e4d503384 server: Added thread check to protect writedata 2017-08-31 15:35:46 -04:00
Justin Berger
693fa0a96e server: Added assert to monitor uv_run status 2017-08-31 15:35:46 -04:00
Justin Berger
882dcef8e0 server: Made connections in a server have a mutex to avoid use after frees 2017-08-31 15:35:44 -04:00
Justin Berger
7ef2884361 server: Moved buffer formatting into bufferstrategy 2017-08-31 15:35:04 -04:00
Justin Berger
6afc7f8828 server: Remove unused fields / functions 2017-08-31 15:35:03 -04:00
Justin Berger
1a50cd8c68 server: Fixed minor memory leaks 2017-08-31 15:35:03 -04:00
Justin Berger
546a587469 server: Fixed mismatched new/delete; added proper shutdown procedure 2017-08-31 15:35:03 -04:00
Daniel Pfeifer
7ddd43183d Merge topic 'cstyle-casts'
190e3825 Replace C-style casts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1176
2017-08-30 06:38:00 -04:00
Daniel Pfeifer
190e3825d4 Replace C-style casts 2017-08-27 09:58:46 +02:00
Daniel Pfeifer
4614a3b287 server: backport to C++11 2017-08-26 07:46:57 +02:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Brad King
fc4f352513 Merge topic 'server-refactor'
cf0ae55d server: Add support for connections that aren't event based
5ddfb6a4 server: Add connection as part of a request
d4f5d35c server: Refactor to make the event loop owned by server object
5acbf08b Tests: Teach Server test to forward exit code from server process

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !552
2017-07-18 11:14:02 -04:00
Justin Berger
cf0ae55dcb server: Add support for connections that aren't event based 2017-07-10 18:12:05 -06:00
Justin Berger
5ddfb6a472 server: Add connection as part of a request 2017-07-10 18:11:33 -06:00
Justin Berger
d4f5d35ca4 server: Refactor to make the event loop owned by server object 2017-07-10 18:11:27 -06:00
Ivan Shcherbakov
4db3227514 server: Rename cmServerProtocol1_0 to cmServerProtocol1
It will serve additional minor versions.

Suggested-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-06 11:03:14 -04:00
Brad King
aa7e9a9674 cmServer: Fix compiler -Wdouble-promotion warning 2017-05-24 10:55:45 -04:00
Daniel Pfeifer
f3e216131b cmServer: include what you use 2017-05-06 00:03:47 +02:00
Daniel Pfeifer
2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Tobias Hunger
0d96e19329 server-mode: Add infrastructure to watch the filesystem
Enable the server to watch for filesystem changes. This patch includes
* The infrastructure for the file watching
* makes that infrastructure available to cmServerProtocols
* Resets the filesystemwatchers on "configure"
2016-09-29 21:47:05 +02:00
Brad King
86578eccf2 Simplify CMake per-source license notices
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.
2016-09-27 15:14:44 -04:00
Daniel Pfeifer
92207752df cmServer: add braces around conditional statements 2016-09-23 22:43:36 +02:00
Tobias Hunger
e22d30e25a server-mode: Allow for sending signals
Enable the server to send signals.
2016-09-22 16:30:03 +02:00
Tobias Hunger
cc576c2c7f server-mode: Pass server into cmServerProtocol
The information will be needed to send signals.
2016-09-22 16:30:02 +02:00
Tobias Hunger
277ffa2881 server-mode: Move constants for server mode into its own file
This removes some duplication and makes it easier to reuse the
vocabulary.
2016-09-22 16:30:02 +02:00
Tobias Hunger
1d601c6cb9 server-mode: Introduce cmServerConnection
Use it to split pipe and stdin/out handling out of cmServer itself.

The server will shut down when it looses its connection to the client.
This has the nice property that a crashing client will cause the server
to terminate as the OS will close the connection on behave of the client.
2016-09-22 08:06:38 -04:00
Tobias Hunger
4fb2b41a58 server-mode: Add debug support
Enable the server to support development with some helper tools:

You can now request debug information with statistics on how
long execution of a command took, how long it took to serialize
the JSON files, and how big the serialized JSON string is.

Also allow to dump results into a file.
2016-09-20 20:52:44 +02:00
Tobias Hunger
537efe0561 server-mode: Report Messages from cmake to clients
Pass messages sent from cmake via Error(...) or Message(...) on
to clients.
2016-09-20 20:52:38 +02:00
Tobias Hunger
ca7799482c server-mode: Automate progress reporting
Wire up cmake::SetProgressUpdate to do progress reporting via the
cmake server.
2016-09-20 20:48:10 +02:00
Tobias Hunger
70b8ba9a0f cmake-server: Use consistent constant naming style 2016-09-20 20:48:06 +02:00
Tobias Hunger
7df8a8f276 server-mode: Add --experimental flag
Allow for experimental cmProtocolVersions, which will only ever get
listed if the server was started with the (undocumented)
"--experimental" flag.

Mark current protocol version 1.0 as experimental.
2016-09-20 08:32:26 -04:00
Tobias Hunger
d341d077c5 cmake-server: Implement ServerProtocol 1.0
Enable the initial handshake of the client to complete the connection
to the server.

The handshake sets the protocol version that client and server will
use to talk to each other. The only way to change this is to quit the
server and start over.

CMake specific information is also set during the initial handshake.
Since cmake so far never had to change basic information about any project
while running, it was decided to keep this information static and
require a restart of the cmake server to change any of these.
2016-09-19 08:57:57 -04:00
Tobias Hunger
b13d3e0d0b cmake-server: Bare-bones server implementation
Adds a bare-bones cmake-server implementation and makes it possible
to start that with "cmake -E server".

Communication happens via stdin/stdout for now.

Protocol is based on Json objects surrounded by magic strings
("[== CMake Server ==[" and "]== CMake Server ==]"), which simplifies
Json parsing significantly.

This patch also defines an interface used to implement different
versions of the protocol spoken by the server, but does not include
any protocol implementaiton.
2016-09-19 08:57:57 -04:00