Commit Graph

43 Commits

Author SHA1 Message Date
Tobias Hunger
c0bd1eb6d0 server-mode: Do not crash when running into INTERFACE_LIBRARY
Closes: #16539
2017-01-09 16:40:46 -05:00
Brad King
a0ed39ac22 Merge topic 'mr-reset-error-flag-on-configure'
7789dd9a server-mode: Call ResetErrorOccured before configure
2017-01-09 16:27:19 -05:00
Tobias Hunger
7789dd9a1a server-mode: Call ResetErrorOccured before configure
Closes: #16506
2016-12-16 08:54:37 -05:00
Daniel Pfeifer
58c66393cf clang-tidy: apply readability-static-definition-in-anonymous-namespace fixes 2016-12-12 14:04:15 -05:00
Brad King
f6f42b25c8 Merge topic 'src-COMPILE_FLAGS-genex'
5dec0a23 server-mode: Fix per-source COMPILE_FLAGS genex evaluation
2016-12-05 09:23:22 -05:00
Tobias Hunger
5dec0a2328 server-mode: Fix per-source COMPILE_FLAGS genex evaluation
Logic added by commit 1e4bb358 (Add generator expression support to
per-source COMPILE_FLAGS, 2016-10-25) accidentally frees memory before
finishing with it.  Revise the logic to hold the memory long enough.
2016-12-02 10:15:50 -05:00
Brad King
23a63d2024 Merge topic 'cmake-server-pad-arguments'
28e891f0 server-mode: Do not ignore the first cacheArgument on configure
2016-12-01 08:50:41 -05:00
Tobias Hunger
28e891f0c7 server-mode: Do not ignore the first cacheArgument on configure
SetCacheArgs skips the first argument it gets, so add some padding before
calling it.
2016-11-30 13:14:15 -05:00
Brad King
dadccc752e Merge topic 'cmake-server-fix-16423'
516a2cd3 server-mode: Reset GlobalGenerator before configure
2016-11-15 09:26:07 -05:00
Tobias Hunger
516a2cd360 server-mode: Reset GlobalGenerator before configure
This is what cmake-gui also does to avoid CMake crashing on repeated
attempts to configure it.

Fixes #16423.
2016-11-14 11:06:37 -05:00
Brad King
01567fd74f Merge topic 'src-COMPILE_FLAGS-genex'
9a58517d Tests: Add case for Xcode per-config per-source COMPILE_FLAGS diagnostic
1e4bb358 Add generator expression support to per-source COMPILE_FLAGS
2016-11-01 09:14:25 -04:00
Daniel Pfeifer
5214bb354b Avoid some copies 2016-10-30 19:50:19 +01:00
Zsolt Parragi
1e4bb35894 Add generator expression support to per-source COMPILE_FLAGS
This allows users to specify different genex-based compile flags for
each file in a target, e.g. compiling just a single file with `Od/Ox` in
release builds on Visual Studio.
2016-10-28 11:18:03 -04:00
Brad King
18a966c80f Merge topic 'cmake-server-handshake-improvements'
42ccbee1 server-mode: Handle generator toolset and platform in handshake
d792491c cmake-server: Better error reporting during handshake
2016-10-28 08:26:49 -04:00
Tobias Hunger
42ccbee11c server-mode: Handle generator toolset and platform in handshake 2016-10-28 13:46:15 +02:00
Tobias Hunger
d792491c40 cmake-server: Better error reporting during handshake
Catch more problematic input during handshake and report failure.

These were caught before when trying to configure, but it is way better
to get these reports early.
2016-10-27 14:18:42 -04:00
Brad King
a5f4463eed Merge topic 'clang-tidy'
effa6c83 fix more issues reported by clang-tidy
fb461cac silence selected clang-tidy violations
2016-10-20 08:51:09 -04:00
Daniel Pfeifer
effa6c8343 fix more issues reported by clang-tidy 2016-10-20 08:48:20 -04:00
Stephen Kelly
a49751fb2e cmState: Move TargetType enum to separate namespace 2016-10-19 15:40:58 +02:00
Stephen Kelly
163991dd83 cmServerProtocol: Remove unused header 2016-10-18 21:28:45 +02:00
Stephen Kelly
f03d446e96 cmLinkLineComputer: Move FrameworkPath computation from cmLocalGenerator
Add UseWatcomQuote state, and remove corresponding method parameters.
2016-10-10 20:38:59 +02:00
Stephen Kelly
0c97806325 cmLinkLineComputer: Move ComputeLinkLibs from cmLocalGenerator
Add a cmOutputConverter to the cmLinkLineComputer and factory methods to
facilitate shell escapes.

Add state to the cmLinkLineComputer to record whether outputting for
response files or for watcom, to satisfy the cmOutputConverter API.
These are constant for the lifetime of the cmLinkLineComputer, even when
its functionality is extended in the future.  This also keeps the
signatures of cmLinkLineComputer relatively simple.

Pass the cmComputeLinkInformation as a method parameter so that
cmLinkLineComputer is free from target-specific state.  An instance
should be usable for all targets in a directory.
2016-10-10 20:38:58 +02:00
Stephen Kelly
5b361fdda0 cmLinkLineComputer: Extract from cmLocalGenerator
CMake has several classes which have too many responsibilities.
cmLocalGenerator is one of them.  Start to extract the link line
computation.  Create generator-specific implementations of the interface
to account for generator-specific behavior.

Unfortunately MSVC60 has different behavior to everything else and CMake
still generates makefiles for it.  Isolate it with MSVC60-specific
names.
2016-10-10 20:38:53 +02:00
Tobias Hunger
4e34f04250 server-mode: Watch CMakeLists.txt files
Watch CMakeLists.txt files (and similar) from the Server
2016-09-29 22:34:10 +02:00
Tobias Hunger
262500028c server-mode: Report watched files to client
* Add a command to report watched files and directories to clients.
2016-09-29 21:47:05 +02: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
Tobias Hunger
7b1e60f26e server-mode: Report CMakeCache entries
With this it would be possible to implement something like
cmake-gui using server-mode.
2016-09-28 18:32:55 +02:00
Tobias Hunger
84553a6e70 server-mode: Add command to retrieve build system files
Add a command to retrieve files that are input to cmake itself.
2016-09-28 18:32:54 +02:00
Tobias Hunger
ead71873b2 server-mode: Report information relevant for a codemodel
Add "codemodel" command to report information relevant to feed a code
model.
2016-09-28 18:32:54 +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
Tobias Hunger
890432672b server-mode: Add command to compute the build system 2016-09-26 14:33:12 -04:00
Tobias Hunger
0a8ad6700e server-mode: Add a configure command
Add a command to trigger cmake to configure a project.

Keep this separate from the compute step (added in the next commit)
to faciliate applications like cmake-gui.
2016-09-26 14:32:22 -04:00
Tobias Hunger
544f65f44d server-mode: Set global configuration of cmake via a command
"setGlobalSettings" can be used to change settings reported by
"globalSettings" command.
2016-09-26 14:25:20 -04:00
Tobias Hunger
82104cc7a8 server-mode: Query global configuration of cmake via a command
Add "globalSettings" command that returns:
* Return capability information
* Return currently used generator/extra generator
* Return a range of flags for debug/trace/etc.
2016-09-26 14:23:53 -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
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
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