Commit Graph

18422 Commits

Author SHA1 Message Date
Brad King bf365792a1 Merge branch 'upstream-kwsys' into update-kwsys 2015-05-28 08:21:55 -04:00
Kitware Robot 2d4bef07d9 CMake Nightly Date Stamp 2015-05-28 00:01:11 -04:00
Brad King cf86696ae8 Merge branch 'ctest-update-gmake-error-match' into release 2015-05-27 11:52:20 -04:00
Zack Galbreath 44a4e54547 ctest_build: Fix regression in GNU make error message matching
The regex update in commit v3.1.2~4^2 (ctest_build: Update GNU make
error message matching, 2015-01-28) broke matching of the messages it
updated.  Remove the escape character before the square brackets added
by that commit.
2015-05-27 11:48:38 -04:00
Brad King c12fc3573b Merge topic 'inject-state-snapshot'
3b880a07 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
e12afe76 cmState: Host some state from the cmGlobalGenerator.
c7b79aa1 cmGlobalGenerator: Require a cmake instance in ctor.
01e1cd5c cmState: Move snapshot creation to the cmake instance.
2015-05-27 09:23:01 -04:00
Brad King 94e4b5d2c3 Merge topic 'clean-up-GHS'
f69dcdfc GHS: Remove call to SetCurrentLocalGenerator.
a4d230af GHS: Don't attempt to generate for IMPORTED or INTERFACE targets.
550e08b0 GHS: Remove unnecessary condition.
d34467cd GHS: Remove unused CustomCommandUseLocal.
9afc9e84 GHS: Remove BuildFileName.
73245e59 GHS: Remove unnecessary Configure override.
2015-05-27 09:22:59 -04:00
Brad King 95bab020b3 Merge topic 'minor-cleanups'
f5b0a0fb cmMakefile: Don't pop the directory listfile off the stack.
e40fcb59 cmMakefile: Simplify convert condition.
4fdad392 cmake: Remove redundant forward declaration.
df9635f3 cmake: Remove redundant condition.
ad167479 foreach: Remove unused variables.
aaeec642 cmGlobalGenerator: De-virtualize methods with no overrides.
444bc349 Ninja: Remove some bogus comments.
2015-05-27 09:22:57 -04:00
Brad King af570e13fd Merge topic 'ninja-per-target-rules'
9da84ab6 Ninja: Fix regression in .rsp file support
2015-05-27 09:22:55 -04:00
Stephen Kelly 3b880a0741 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
Refactor the local generator creation API to accept a
cmState::Snapshot.  Adjust MakeLocalGenerator to use the 'current'
snapshot in cases where there is no parent.  Create the snapshot
for subdirectories in cmMakefile::AddSubdirectory.

This means that snapshots are now created at the point of extending the tree,
as appropriate, and independently of the cmLocalGenerator and cmMakefile they
represent the state for.
2015-05-27 09:18:32 -04:00
Stephen Kelly e12afe766e cmState: Host some state from the cmGlobalGenerator. 2015-05-27 09:18:31 -04:00
Stephen Kelly c7b79aa16a cmGlobalGenerator: Require a cmake instance in ctor.
It is required anyway, so this makes it explicit.
2015-05-27 09:18:31 -04:00
Kitware Robot fcafd0cfc6 CMake Nightly Date Stamp 2015-05-27 00:01:07 -04:00
Daniel Pfeifer de2ef3053c cmCTest: Drop unused method overloads
The StartXML, EndXML, and AddSiteProperties overloads that take a stream
directly are no longer called anywhere.  All clients hvae been ported to
cmXMLWriter.  Drop the old overloads.
2015-05-26 11:09:22 -04:00
Daniel Pfeifer b04500a725 cmCTest{Test,MemCheck}Handler: Port to cmXMLWriter 2015-05-26 11:09:22 -04:00
Daniel Pfeifer 8fbc509a48 cmCTestCoverageHandler: Port to cmXMLWriter 2015-05-26 11:09:22 -04:00
Daniel Pfeifer 82455a9d3a cmCTestBuildHandler: Port to cmXMLWriter 2015-05-26 11:09:22 -04:00
Daniel Pfeifer 1dbd86fd6d cmCTestLaunch: Port to cmXMLWriter 2015-05-26 11:09:21 -04:00
Daniel Pfeifer a53bd63e0c cmCTest: Port GenerateNotesFile to cmXMLWriter 2015-05-26 11:09:21 -04:00
Daniel Pfeifer 9c0bb7d807 cmCTestConfigureHandler: Port to cmXMLWriter 2015-05-26 11:09:21 -04:00
Daniel Pfeifer 6cf5cc717f cmCTestUploadHandler: Port to cmXMLWriter 2015-05-26 11:09:21 -04:00
Daniel Pfeifer ed42c203ed cmCTestUpdateHandler: Port to cmXMLWriter 2015-05-26 11:09:21 -04:00
Daniel Pfeifer 18825bafd9 cmCTest: Port to cmXMLWriter
Re-implement StartXML, EndXML, and AddSiteProperties using cmXMLWriter.
Leave the old overloads behind for use by CTest/* until they are ported.
2015-05-26 11:09:20 -04:00
Daniel Pfeifer f6413400a0 Add cmXMLWriter class to consolidate XML generation
Explicitly track XML generation state (indentation, element closure,
etc.) so that clients can avoid manually/implicitly maintaining it.
2015-05-26 11:09:20 -04:00
Daniel Pfeifer b26e5b552a CTest: Generate NamedMeasurement elements directly into xml file
Re-order the logic to avoid use of a temporary std::ostringstream.
2015-05-26 10:40:00 -04:00
Daniel Pfeifer 965cf8e66e CTest: Drop stray content from Configure.xml
Remove content left accidentally since commit v2.4.0~2876 (some bug
fixes for my recent checkins and some more cleanup, 2004-09-07).
2015-05-26 10:39:45 -04:00
Brad King 12b9005d7c Merge topic 'extend-visibility-properties'
700f1c3b Honor visibility properties for all target types (#15556)
50de5dbb Help: Format visibility property and variable documentation
771f1b00 Tests: Rename Visibility{InlinesHidden =>}
ab55b3b5 Tests: Refactor RunCMake.VisibilityPreset test setup
2015-05-26 09:24:00 -04:00
Brad King 3638641396 Merge topic 'run-include-what-you-use'
b3475ba5 Makefile: Fix <LANG>_INCLUDE_WHAT_YOU_USE with CTEST_USE_LAUNCHERS
2015-05-26 09:23:54 -04:00
Brad King 9da84ab64a Ninja: Fix regression in .rsp file support
In commit a390de65 (Ninja: Generate separate compile and link rules for
each target, 2015-05-18) we removed the _RSP_FILE suffix from rule names
meant for targets that need to build with a .rsp file because we now use
per-target rules anyway.  Remove this suffix from references to the rule
too.

Reported-by: Herz Thomas <Thomas.Herz@kuka.com>
2015-05-26 09:15:10 -04:00
Brad King 700f1c3b2b Honor visibility properties for all target types (#15556)
The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN were first
merged in commit v2.8.12~322 (Merge topic 'VISIBILITY_PRESET-property',
2013-06-05) but worked only for shared libraries and executables with
exports.  Prior to commit v3.0.0-rc1~581^2 (GenerateExportHeader:
Deprecate add_compiler_export_flags function., 2013-09-02) the
add_compiler_export_flags function was used to add visibility flags to
all targets.

The visibility flags are useful for sources in all target types because
they may be later linked into shared libraries or executables with
exports.  Introduce policy CMP0063 to enable them for all target types
while preserving compatibility with existing projects that do not expect
this.
2015-05-26 09:03:16 -04:00
Kitware Robot 4f0125a45b CMake Nightly Date Stamp 2015-05-26 00:01:05 -04:00
Stephen Kelly f5b0a0fba4 cmMakefile: Don't pop the directory listfile off the stack.
Simplify the IssueMessage implementation.
2015-05-25 09:49:59 +02:00
Stephen Kelly e40fcb598d cmMakefile: Simplify convert condition.
The CallStack is checked above.
2015-05-25 09:21:56 +02:00
Kitware Robot cd8698167a CMake Nightly Date Stamp 2015-05-25 00:01:06 -04:00
Stephen Kelly 01e1cd5c1f cmState: Move snapshot creation to the cmake instance.
Don't create a snapshot in Initialize(), but leave the creation
responsibility to the cmake instance instead.  Previously, the
cmState would Initialize() in its constructor, and the cmake instance
would re-Initialize() during Configure().  The end result was the
same and there would be one snapshot present.  However, cmLocalGenerator
also created a snapshot on construction, and that one was used, leaving
the first snapshot unused, and potential for off-by-one errors.

Fix that by making the cmLocalGenerator use the existing snapshot
if it is top-level.  Add a CurrentSnapshot to the cmake instance and
populated it while configuring a directory.  This will eventually
replace the 'current local generator' concept.  Fix the GetParent
implementation to be able to return the first snapshot.
2015-05-24 13:30:24 +02:00
Stephen Kelly f69dcdfc38 GHS: Remove call to SetCurrentLocalGenerator.
It is not needed as cmLocalGenerator::Configure does this.
2015-05-24 13:29:48 +02:00
Stephen Kelly a4d230af7d GHS: Don't attempt to generate for IMPORTED or INTERFACE targets. 2015-05-24 13:29:48 +02:00
Stephen Kelly 550e08b012 GHS: Remove unnecessary condition. 2015-05-24 13:29:48 +02:00
Stephen Kelly d34467cd58 GHS: Remove unused CustomCommandUseLocal.
This was copied from the VS generator.  It is not an override of a base
class method.
2015-05-24 13:29:48 +02:00
Stephen Kelly 9afc9e8478 GHS: Remove BuildFileName.
It is never read or written.
2015-05-24 13:29:48 +02:00
Stephen Kelly 73245e5911 GHS: Remove unnecessary Configure override.
This only sets a member variable which is never read.  Presumably
this was copied from the makefile generator.
2015-05-24 13:29:48 +02:00
Stephen Kelly 4fdad392b6 cmake: Remove redundant forward declaration.
The appropriate include is already here.
2015-05-24 12:56:09 +02:00
Stephen Kelly df9635f386 cmake: Remove redundant condition. 2015-05-24 12:55:43 +02:00
Stephen Kelly ad16747927 foreach: Remove unused variables. 2015-05-24 11:09:59 +02:00
Stephen Kelly aaeec642ca cmGlobalGenerator: De-virtualize methods with no overrides. 2015-05-24 11:09:58 +02:00
Kitware Robot c2f5e5c632 CMake Nightly Date Stamp 2015-05-24 00:01:05 -04:00
Stephen Kelly 444bc34978 Ninja: Remove some bogus comments.
The virtual methods are overrides not overloads, the constructor
is no longer a default variant, the destructor and GetCMakeInstance
comments add no value, only a typo.
2015-05-23 14:56:33 +02:00
Kitware Robot 7e2984e279 CMake Nightly Date Stamp 2015-05-23 00:01:06 -04:00
Brad King d0f59d3598 Merge topic 'clean-up-backtrace-handling'
8b4b9631 cmake: Add IssueMessage overload taking a single cmListFileContext.
46656aa1 cmake: Extract displayMessage method.
55fc5e7c cmake: Extract printMessageText method.
ca7cc2eb cmake: Extract PrintMessagePreamble method.
fa752bf3 cmake: Move isError determination to a more-natural place.
2015-05-22 09:39:54 -04:00
Brad King edf84ab3e9 Merge topic 'vs-cleanup-internal-configs'
2f4bb4e9 VS: Do not accumulate configurations globally (#15577)
2015-05-22 09:39:52 -04:00
Brad King cd679aa820 Merge topic 'revert-extra-qbs-generator'
deec97d8 Revert "Qbs: Add new 'extra' generator for qbs project files"
2015-05-22 09:39:50 -04:00
Brad King b3475ba57b Makefile: Fix <LANG>_INCLUDE_WHAT_YOU_USE with CTEST_USE_LAUNCHERS
The 'ctest --launch' command must be placed before the IWYU launcher on
the compiler command line.  Extend the RunCMake.IncludeWhatYouUse test
to cover this case.  The Ninja generator already does it correctly.
2015-05-22 08:44:46 -04:00
Kitware Robot 57b5b07461 CMake Nightly Date Stamp 2015-05-22 00:01:07 -04:00
Stephen Kelly 8b4b9631f5 cmake: Add IssueMessage overload taking a single cmListFileContext.
Port appropriate clients to use it.
2015-05-22 01:21:35 +02:00
Stephen Kelly 46656aa1fa cmake: Extract displayMessage method. 2015-05-22 00:54:28 +02:00
Stephen Kelly 55fc5e7c9a cmake: Extract printMessageText method. 2015-05-22 00:54:27 +02:00
Stephen Kelly ca7cc2ebd0 cmake: Extract PrintMessagePreamble method. 2015-05-22 00:54:26 +02:00
Stephen Kelly fa752bf339 cmake: Move isError determination to a more-natural place. 2015-05-22 00:54:26 +02:00
Brad King 2f4bb4e9b0 VS: Do not accumulate configurations globally (#15577)
Drop the VS >= 7 generator's global Configurations member and instead
lookup configurations using cmMakefile::GetConfigurations where needed.
This avoids accumulating all CMAKE_CONFIGURATION_TYPES values ever
encountered by a project() or enable_language() command and allows
the final value to be used in each directory.  We don't officially
support per-directory CMAKE_CONFIGURATION_TYPES values but we certainly
should not generate configurations not in the final value in the top
level directory.
2015-05-21 09:06:49 -04:00
Brad King deec97d8ec Revert "Qbs: Add new 'extra' generator for qbs project files"
This reverts commit f85db2f323.

Discussion by the QtCreator community at

  https://bugreports.qt.io/browse/QTCREATORBUG-13695

raises concerns about this particular approach to working with CMake
projects using QtCreator.  Also, the functionality and design of the QBS
extra generator was never discussed on the CMake mailing list or with
QtCreator developers.  There may be better ways to make the two tools
work together.

In order to avoid committing to long-term support of this generator
prior to such discussion taking place, revert it from CMake for now.
We may restore this or use an alternative design based on results of
such discussion.
2015-05-21 09:05:58 -04:00
Brad King db90e7c6bc Merge topic 'clean-up-cmLocalGenerator'
e54d2fdf Convert: Remove specification of default parameter.
20c2fe4d cmLocalGenerator: Get enabled languages from cmState.
7601a7b1 cmLocalGenerator: Implement IsRootMakefile in terms of cmState.
4080ca49 cmLocalGenerator: Inline ReadListFile method.
ad706819 cmLocalGenerator: Devirtualize method.
2015-05-21 09:03:54 -04:00
Brad King 3e3a09d1d3 Merge topic 'clean-up-CMAKE_COMMAND'
6fbd4cae Use cmSystemTools::GetCMakeCommand() to get path to cmake internally
2015-05-21 09:03:52 -04:00
Brad King 2c54622ff5 Merge topic 'cmake-gui-osx-install-command-line'
e462ef74 Help: Add notes for topic 'cmake-gui-osx-install-command-line'
8ea2db26 cmake-gui: Replace command-line install dialog with information box
438ce4a0 cmake-gui: Add --install option to add command-line tools on OS X
41477d5c cmake-gui: Drop undocumented and unused --mac-install option
2015-05-21 09:03:50 -04:00
Brad King f3e4e3ecde Merge topic 'doc-cache-option-space'
b0ea3673 Help: Spell '-D' option consistently across documentation (#15575)
2015-05-21 09:03:48 -04:00
Brad King e604bb1be9 Merge topic 'clean-up-cmQtAutoGenerators'
a5b59fae QtAutogen: Create global generator on the stack.
fe401ede QtAutogen: Use a more-obvious delete-target.
c95a55ad QtAutogen: Remove the need for a local makefile variable.
460e8fb9 QtAutogen: Inline static factory method.
58f41c78 QtAutogen: Remove repeated setters.
2015-05-21 09:03:46 -04:00
Brad King f05d9308c9 Merge topic 'clean-up-cmMakefile'
b9f99155 cmMakefile: Remove VarUsageStack.
2b09d9f3 cmMakefile: Remove VarInitStack.
528d6802 cmMakefile: Use more suitable method name to log var usage.
9118b53b cmMakefile: Move internal method to private scope.
f58c3774 cmMakefile: Mark definitions explicitly erased, even at top level.
ea7b962b cmMakefile: Raise variable in scope explicitly when needed.
c8cb6688 cmMakefile: Use early return to reduce nested code.
bdd1aa91 cmMakefile: Don't use else after return.
c42f0e2b cmMakefile: Remove redundant conditions.
caff8e5a cmCTest: Remove unimplemented method.
bb1e8c3a cmMakefile: Remove Print() debugging facilities.
1363bff8 cmMakefile: Remove duplicate variable initialization.
5b7ff35c cmMakefile: Don't expect the VarStack iterator to support size().
390bc324 cmMakefile: Remove redundant condition.
8ab1cce7 cmMakefile: Rename method to something more appropriate.
2dd5d42f cmMakefile: Make the public ReadListFile method take one param.
...
2015-05-21 09:03:44 -04:00
Brad King 03a65dab30 Merge topic 'run-include-what-you-use'
ada5ffce Add options to run include-what-you-use with the compiler
67fa3da9 cmake: Add internal -E mode to run include-what-you-use with the compiler
2015-05-21 09:03:40 -04:00
Brad King 8ea2db2639 cmake-gui: Replace command-line install dialog with information box
The QMacInstallDialog infrastructure no longer works on modern OS X
versions.  Drop it and replace the dialog with a simple info box that
explains to the user how to run 'cmake-gui --install' to add symlinks.
Also suggest simply modifying the PATH.

This approach is similar to the Xcode 'xcode-select --install' method
of installing Xcode Command Line Tools.
2015-05-21 08:59:32 -04:00
Brad King 438ce4a0fb cmake-gui: Add --install option to add command-line tools on OS X
On OS X add an "--install[=/path/to/bin]" option (defaulting to
/usr/bin) that installs symbolic links into the given directory.
This will help OS X users make the tools available on the command
line even when they sit inside a CMake.app bundle.
2015-05-21 08:59:31 -04:00
Kitware Robot f3c308dd82 CMake Nightly Date Stamp 2015-05-21 00:01:06 -04:00
Stephen Kelly e54d2fdf50 Convert: Remove specification of default parameter. 2015-05-20 11:21:10 -04:00
Stephen Kelly 20c2fe4d10 cmLocalGenerator: Get enabled languages from cmState. 2015-05-20 11:21:10 -04:00
Stephen Kelly 7601a7b12d cmLocalGenerator: Implement IsRootMakefile in terms of cmState. 2015-05-20 11:21:09 -04:00
Stephen Kelly 4080ca497e cmLocalGenerator: Inline ReadListFile method. 2015-05-20 11:21:09 -04:00
Stephen Kelly ad70681909 cmLocalGenerator: Devirtualize method. 2015-05-20 11:21:09 -04:00
Brad King 6fbd4cae0d Use cmSystemTools::GetCMakeCommand() to get path to cmake internally
This is much simpler than finding a way to lookup "CMAKE_COMMAND"
everywhere.
2015-05-20 11:20:42 -04:00
Brad King b0ea367308 Help: Spell '-D' option consistently across documentation (#15575)
Always show the option with its argument separate in summary text.
State in the main documentation that the option and its argument can be
given together too.
2015-05-20 08:30:36 -04:00
Kitware Robot e6fac4f8d9 CMake Nightly Date Stamp 2015-05-20 00:01:46 -04:00
Stephen Kelly a5b59fae15 QtAutogen: Create global generator on the stack. 2015-05-20 00:30:16 +02:00
Stephen Kelly fe401ede2a QtAutogen: Use a more-obvious delete-target. 2015-05-20 00:30:15 +02:00
Stephen Kelly c95a55ad5a QtAutogen: Remove the need for a local makefile variable. 2015-05-20 00:30:13 +02:00
Stephen Kelly 460e8fb9ad QtAutogen: Inline static factory method. 2015-05-20 00:23:28 +02:00
Stephen Kelly 58f41c789f QtAutogen: Remove repeated setters.
These methods are called already just before calling the static method.
2015-05-20 00:22:51 +02:00
Stephen Kelly b9f9915516 cmMakefile: Remove VarUsageStack.
Store usage information in the cmDefintions value instead.  We already
pay for the memory as padding in the Def struct, so we might as well
use it.
2015-05-19 22:36:53 +02:00
Stephen Kelly 2b09d9f346 cmMakefile: Remove VarInitStack.
In cmMakefile::PushScope, a copy of the closure of keys initialized
in the parent scope is made.  In PopScope, essentially the same copy
is inserted back into the parent.  That means a lot of duplication
of strings and a lot of string comparisons.  None of it is needed,
because the cmDefinitions keys already provide a canonical
representation of what is initialized.

The removal of the separate container also makes the variable handling
code more easy to reason about in general.

Before this patch, configuring llvm uses 200 KiB for the VarInitStack.
Overall peak memory consumption goes from 35.5 MiB to 35.1 MiB.
2015-05-19 22:36:53 +02:00
Stephen Kelly 528d68021c cmMakefile: Use more suitable method name to log var usage. 2015-05-19 22:36:52 +02:00
Stephen Kelly 9118b53b79 cmMakefile: Move internal method to private scope. 2015-05-19 22:36:52 +02:00
Stephen Kelly f58c3774d1 cmMakefile: Mark definitions explicitly erased, even at top level.
Presumably the intention here is to attempt to optimize memory by not
storing what is not needed.  However, all keys need to be tracked
anyway to implement initialization tracking, and this special case
gets in the way of simplifying the implementation of that.

This doesn't change any observable effects because values set
to 0 are considered not to exist by the cmDefinitions API.
2015-05-19 22:36:52 +02:00
Stephen Kelly ea7b962be2 cmMakefile: Raise variable in scope explicitly when needed.
The Get method implicitly pulls a copy of all variables into a local scope. This
is not necessary.
2015-05-19 22:36:51 +02:00
Stephen Kelly c8cb66880c cmMakefile: Use early return to reduce nested code. 2015-05-19 22:36:51 +02:00
Stephen Kelly bdd1aa91ae cmMakefile: Don't use else after return. 2015-05-19 22:36:51 +02:00
Stephen Kelly c42f0e2b3e cmMakefile: Remove redundant conditions.
This container is never empty.
2015-05-19 22:36:51 +02:00
Stephen Kelly caff8e5a3e cmCTest: Remove unimplemented method. 2015-05-19 22:36:51 +02:00
Stephen Kelly bb1e8c3adf cmMakefile: Remove Print() debugging facilities.
They don't print things that are important in the modern implementation.
2015-05-19 22:36:50 +02:00
Stephen Kelly 1363bff83a cmMakefile: Remove duplicate variable initialization. 2015-05-19 22:36:50 +02:00
Stephen Kelly 5b7ff35c4d cmMakefile: Don't expect the VarStack iterator to support size(). 2015-05-19 22:36:50 +02:00
Stephen Kelly 390bc3244f cmMakefile: Remove redundant condition.
As this is called in the constructor, the definition will never be already
set.
2015-05-19 22:36:49 +02:00
Stephen Kelly 8ab1cce704 cmMakefile: Rename method to something more appropriate.
Allow the name to be used for something more-suitable.
2015-05-19 22:36:49 +02:00
Stephen Kelly 2dd5d42f52 cmMakefile: Make the public ReadListFile method take one param.
Make the existing method a private overload. All external callers
invoke the method with only one argument.
2015-05-19 22:36:49 +02:00
Stephen Kelly f3e6a336f2 cmMakefile: Remove CurrentListFile member.
It is never read externally.  The CollapseFullPath removed in this commit
is a repeat of a similar call inside ReadListFile.
2015-05-19 22:36:48 +02:00
Stephen Kelly 6b9e647239 cmMakefile: Port CurrentListFile clients to GetDefinition.
There is no need to store this as a member variable.
2015-05-19 22:36:48 +02:00