Commit Graph

20383 Commits

Author SHA1 Message Date
Brad King 2faa8b3620 Add call stack to unused/uninitialized variable warnings
In commit v2.8.4~32^2~14 (Use cmake::IssueMessage for warnings,
2010-12-07) these warnings became formatted.  It is more informative to
give the full call stack with such warnings.  Also it is easier to
implement warnings with a full call stack because we do not have to
construct a custom backtrace with only the top.
2016-04-15 10:13:12 -04:00
Brad King da07c506b9 cmLocalGenerator: Simplify IssueMessage implementation
This method was added by commit v3.4.0-rc1~424^2~6 (cmLocalGenerator:
Add IssueMessage method, 2015-06-13) in order to reduce callers'
dependency on cmMakefile.  Currently the implementation of
cmLocalGenerator::IssueMessage is just a copy of the post-configure code
path in cmMakefile::IssueMessage.  De-duplicate the implementation by
simply calling the cmMakefile copy for now.  This will simplify upcoming
refactoring of backtraces.  The dependency on cmMakefile can be removed
by future work once that is done.
2016-04-15 10:13:08 -04:00
Brad King cc7aed77a8 cmLocalGenerator: Use own IssueMessage method 2016-04-15 08:34:05 -04:00
Brad King c50285dee6 cmOutputConverter: Assert construction with a valid snapshot
We unconditionally use information from the snapshot so it must be
valid.
2016-04-15 08:34:05 -04:00
Brad King b6ed71b17c cmMakefile: Move cmMakefileCall to .cxx file 2016-04-15 08:32:15 -04:00
Brad King a559f0f6b0 cmWhileCommand: Simplify context construction 2016-04-15 08:31:59 -04:00
Brad King 7503deb2c5 cmIfCommand: Simplify execution context construction 2016-04-15 08:29:42 -04:00
Kitware Robot c42aa3ed8b CMake Nightly Date Stamp 2016-04-15 00:01:05 -04:00
Kitware Robot 003d4e5752 CMake Nightly Date Stamp 2016-04-14 00:01:06 -04:00
Brad King f5da19edd0 Merge topic 'cmState-rename-include-snapshot'
c54ed781 cmState: Rename CallStack snapshots to IncludeFile
2016-04-13 09:58:21 -04:00
Brad King eae4cee0b5 Merge topic 'try_compile-config-flags'
bd581a37 try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes (#16054)
82ef90fc cmCoreTryCompile: Factor out config lookup for re-use
2016-04-13 09:58:18 -04:00
Brad King 1dc78fecc7 Merge topic 'clang-tidy'
5e62444c Add options to run clang-tidy with the compiler
2016-04-13 09:58:08 -04:00
Daniel Pfeifer 5e62444cff Add options to run clang-tidy with the compiler
Create a <LANG>_CLANG_TIDY target property (initialized by a
CMAKE_<LANG>_CLANG_TIDY variable) to specify a clang-tidy command line
to be run along with the compiler.
2016-04-13 09:56:10 -04:00
Kitware Robot d0b2ec3e71 CMake Nightly Date Stamp 2016-04-13 00:01:05 -04:00
Brad King c54ed7813f cmState: Rename CallStack snapshots to IncludeFile 2016-04-12 16:08:24 -04:00
Kitware Robot a2ce4e81d5 CMake Nightly Date Stamp 2016-04-12 00:01:07 -04:00
Brad King bd581a3733 try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes (#16054)
In the `try_compile` source file signature we propagate the caller's
value of `CMAKE_<LANG>_FLAGS` into the test project.  Extend this to
propagate `CMAKE_<LANG>_FLAGS_<CONFIG>` too instead of always using the
default value in the test project.  This will be useful, for example, to
allow the MSVC runtime library to be changed (e.g. `-MDd` => `-MTd`).
2016-04-11 11:25:08 -04:00
Brad King 82ef90fcfc cmCoreTryCompile: Factor out config lookup for re-use
Store the lookup of CMAKE_TRY_COMPILE_CONFIGURATION in a local variable
so we can re-use it.
2016-04-11 10:39:04 -04:00
Brad King 3a556f005d Merge topic 'preallocate-condition-keywords'
aff4a5fa cmConditionEvaluator: Use pre-allocated keywords in more places
2016-04-11 09:38:58 -04:00
Kitware Robot 7c3fe7e45f CMake Nightly Date Stamp 2016-04-11 00:01:05 -04:00
Kitware Robot 0547e4d509 CMake Nightly Date Stamp 2016-04-10 00:01:04 -04:00
Kitware Robot e2e2461a0d CMake Nightly Date Stamp 2016-04-09 00:01:15 -04:00
Brad King aff4a5fab5 cmConditionEvaluator: Use pre-allocated keywords in more places
Inspired-by: Harry Mallon <Harry@codexdigital.com>
2016-04-08 10:45:43 -04:00
Brad King f6c5958047 Merge topic 'ninja-restat-custom-command-byproducts'
add7abc8 Ninja: Restat custom command byproducts even with a SYMBOLIC output (#16049)
ff805113 Ninja: Fix detection of custom command symbolic outputs
2016-04-08 09:03:59 -04:00
Brad King 2369f19a7a Merge topic 'ninja-object-rsp'
7731e44f Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules
f9644a2d cmGlobalNinjaGenerator: Clarify logic for forcing use of response files
24c9106b cmNinjaTargetGenerator: Factor out helper for forced response file check
2016-04-08 09:01:50 -04:00
Kitware Robot 2f76effd0a CMake Nightly Date Stamp 2016-04-08 00:01:07 -04:00
Dmitry Ivanov 7731e44f87 Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE for compile rules 2016-04-07 09:45:29 -04:00
Dmitry Ivanov f9644a2d1b cmGlobalNinjaGenerator: Clarify logic for forcing use of response files
Update the WriteBuild method to use a negative command line length limit
to specify that we should force use of response files.
2016-04-07 09:45:29 -04:00
Dmitry Ivanov 24c9106b7b cmNinjaTargetGenerator: Factor out helper for forced response file check 2016-04-07 09:45:26 -04:00
Kitware Robot 8de04f6334 CMake Nightly Date Stamp 2016-04-07 00:01:05 -04:00
Brad King ae2fa89f74 Merge topic 'fortran-line-directives-no-dirs'
f831d752 cmFortranParser: Skip #line directives that do not name files
2016-04-06 09:30:03 -04:00
Kitware Robot 8898a92505 CMake Nightly Date Stamp 2016-04-06 00:01:08 -04:00
Brad King add7abc835 Ninja: Restat custom command byproducts even with a SYMBOLIC output (#16049)
The change in commit v3.5.0-rc1~198^2 (Ninja: Always re-run custom
commands that have symbolic dependencies, 2015-11-19) broke the
byproducts feature added by commit v3.2.0-rc1~340^2~2 (Add an option for
explicit BYPRODUCTS of custom commands, 2014-11-13) when SYMBOLIC
outputs also appear.  This case occurs with AUTORCC-generated custom
targets because the output is SYMBOLIC (to always run) and the generated
file is a byproduct (for restat so dependents do not run unnecessarily).

The two use cases conflict because Ninja does not support per-output
restat.  Favor restat whenever byproducts are present because it is
required for byproducts to work correctly.  In use cases where we want
an always-run chain we simply will not be able to also use byproducts.
2016-04-05 16:20:28 -04:00
Brad King ff805113c7 Ninja: Fix detection of custom command symbolic outputs
Fix logic introduced by commit v3.5.0-rc1~198^2 (Ninja: Always re-run
custom commands that have symbolic dependencies, 2015-11-19) to not
consider only the last output.  We need to know if any output is
SYMBOLIC, so stop checking as soon as one is found.
2016-04-05 16:19:52 -04:00
Brad King f831d752ae cmFortranParser: Skip #line directives that do not name files
Since commit v3.5.0-rc1~241^2~1 (cmFortranParser: Parse #line
directives, 2015-11-02) our Fortran dependency scanner parses `#line`
directives to extract the named files.  However, some compilers produce
`#line` directives that name directories instead of files.  Work around
such cases by verifying that the extracted path names a file and not a
directory.
2016-04-05 12:59:45 -04:00
Brad King fd40b0f875 Merge topic 'ctest-run-submodule-sync'
c18d91ad Help: add release notes for topic 'ctest-run-submodule-sync'
7f560743 cmCTestGIT: run `git submodule sync` before updating submodules
06b310b5 cmCTestGIT: add an option to initialize submodules on update
56c1ea40 cmCTestGIT: fix git version references
2016-04-05 09:38:06 -04:00
Brad King 25a38ecfe7 Merge topic 'cobertura_off_by_one'
398b8800 cmParseCoberturaCoverage: Remove extra coverage line
2016-04-05 09:38:04 -04:00
Brad King adea45e15a Merge topic 'fix-target-alias-in-subdir'
0e44f489 Rename local target lookup methods to clarify purpose
bc30f8b5 Fix lookup of an ALIAS target outside aliased target's directory (#16044)
2016-04-05 09:37:59 -04:00
Kitware Robot 6c60f116cb CMake Nightly Date Stamp 2016-04-05 00:01:05 -04:00
Kitware Robot ff6211e635 CMake Nightly Date Stamp 2016-04-04 00:01:05 -04:00
Kitware Robot 2e8837d00d CMake Nightly Date Stamp 2016-04-03 00:01:04 -04:00
Kitware Robot 228801b9c8 CMake Nightly Date Stamp 2016-04-02 00:01:05 -04:00
Ben Boeckel 7f5607439e cmCTestGIT: run `git submodule sync` before updating submodules
If the URL of a submodule changes upstream, the commits referenced at
the old URL may not be available and will cause an update failure.
2016-04-01 15:50:31 -04:00
Ben Boeckel 06b310b5d5 cmCTestGIT: add an option to initialize submodules on update
Currently, CTest will not initialize any submodules within the already
checked out source tree. Add an option to do so. The use case for not
doing so is that some submodules may not be necessary for the current
test and keeping network usage down may be important.
2016-04-01 15:50:31 -04:00
Ben Boeckel 56c1ea40c5 cmCTestGIT: fix git version references
Git does not use a 4-component version number.
2016-04-01 15:50:27 -04:00
Brad King 0e44f4894f Rename local target lookup methods to clarify purpose
Rename methods:

* `cmMakefile::Find{ => LocalNonAlias}Target`
* `cmLocalGenerator::Find{ => LocalNonAlias}GeneratorTarget`

These names clarify that they are for directory-local target names
and do not consider alias targets.
2016-04-01 15:44:16 -04:00
Brad King bc30f8b5e6 Fix lookup of an ALIAS target outside aliased target's directory (#16044)
Refactoring in commit v3.5.0-rc1~272^2~11 (cmTarget: Implement ALIAS in
terms of name mapping, 2015-10-25) accidentally introduced logic that
assumes ALIAS targets always reference targets in their own directory.
Fix this and add a test case.

The configure-step fix is that `cmMakefile::FindTarget` should not consider
aliases.  The purpose of this method is just to look up targets local to
a directory.  Since ALIAS and normal targets share a namespace we know a
locally defined target will never collide with an ALIAS target anyway.
The method has 3 call sites, and this change is safe for all of them:

* `cmInstallCommand::HandleTargetsMode`: Rejects aliases before the call.
* `cmFLTKWrapUICommand::FinalPass`: Should never have considered aliases.
* `cmMakefile::FindTargetToUse`: Falls back to a global lookup anyway.

The generate-step fix is that `cmLocalGenerator::FindGeneratorTarget`
should not consider aliases.  This method is the generate-step
equivalent to the above.  The method has 2 call sites, and this change
is safe for both of them:

* `cmInstallTargetGenerator::Compute`: Never uses an alias target name.
* `cmLocalGenerator::FindGeneratorTargetToUse`: Falls back to global lookup.

Reported-by: Matteo Settenvini <matteo@member.fsf.org>
2016-04-01 15:44:16 -04:00
Brad King de7f2ae3f1 Merge topic 'eclipse-source-groups'
4828a78c Eclipse: Implement traversal of nested source groups (#15701)
2016-04-01 10:01:58 -04:00
Brad King e8c1363ee8 Merge topic 'update-kwsys'
168e44e2 Merge branch 'upstream-KWSys' into update-kwsys
731ad172 KWSys 2016-03-31 (3392da1d)
2016-04-01 10:01:52 -04:00
Kitware Robot 9e33f02bd9 CMake Nightly Date Stamp 2016-04-01 00:01:07 -04:00
Patrik Lehmann 4828a78c10 Eclipse: Implement traversal of nested source groups (#15701) 2016-03-31 09:34:14 -04:00
Brad King 168e44e202 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-03-31 (3392da1d)
2016-03-31 08:46:50 -04:00
Brad King 0aa736e625 Merge topic 'fix-spelling-typos'
49e82c15 Fix spelling typos in comments and documentation (#16037)
2016-03-31 08:46:03 -04:00
Brad King dea0b6b718 Merge topic 'update-kwsys'
dc333a71 Merge branch 'upstream-KWSys' into update-kwsys
735c41dd KWSys 2016-03-29 (b51abb30)
2016-03-31 08:46:01 -04:00
Brad King e2465c19c6 Merge topic 'preallocate-condition-keywords'
5c324294 cmConditionEvaluator: Pre-allocate keyword strings
2016-03-31 08:45:56 -04:00
Brad King 91d91d9d5d Merge topic 'simplify-condition-context'
2379b3ae cmConditionEvaluator: Remove GetConditionContext method
02fce523 cmConditionEvaluator: Drop unnecessary path conversion
2016-03-31 08:45:54 -04:00
Brad King e0917f29a4 Merge topic 'vs-fortran-MP'
729f5f01 VS: Map Intel Fortran `/MP` flag for multi-processor compilation (#15990)
2016-03-31 08:45:51 -04:00
Kitware Robot b290ddf925 CMake Nightly Date Stamp 2016-03-31 00:01:05 -04:00
Zack Galbreath 398b8800e3 cmParseCoberturaCoverage: Remove extra coverage line
Fix off-by-one error in cmParseCoberturaCoverage that added an
extra blank line to the end of source file being covered.
2016-03-30 14:22:07 -04:00
Kitware Robot 00e4d1220b CMake Nightly Date Stamp 2016-03-30 00:01:06 -04:00
Felix Geyer 49e82c15d5 Fix spelling typos in comments and documentation (#16037)
The Debian package checker tool (lintian) detected several typos in
CMake.
2016-03-29 14:31:02 -04:00
Brad King dc333a7115 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-03-29 (b51abb30)
2016-03-29 14:29:42 -04:00
Brad King 5c324294ce cmConditionEvaluator: Pre-allocate keyword strings
Calls to `IsKeyword("...")` cause runtime construction of std::string.
Avoid possible repeated allocation by pre-allocating keyword strings
during initialization.
2016-03-29 10:32:28 -04:00
Brad King 2379b3ae31 cmConditionEvaluator: Remove GetConditionContext method
All it does is call cmListFileContext::FromCommandContext, so move this
to the call sites.
2016-03-29 10:10:20 -04:00
Brad King 02fce523a1 cmConditionEvaluator: Drop unnecessary path conversion
In commit v3.4.0-rc2~1^2 (cmIfCommand: Issue CMP0054 warning with
appropriate context, 2015-10-20) we added construction of a
cmListFileContext with conversion of the calling file path.  This code
path runs on every condition (e.g. `if()`) and so the path conversion
has a noticeable performance cost.  Fortunately the only use of this
context is for insertion into cmMakefile::CMP0054ReportedIds so we do
not need to convert the path.  Simply drop the conversion.
2016-03-29 10:02:17 -04:00
Brad King 2ab344a1dc Merge topic 'ghs-link-flags'
36ad8dd4 GHS: Implement link flags and dirs for non-target groups (#16029)
230d50ed GHS: Factor out compiler information shared among languages
2016-03-29 09:24:36 -04:00
Brad King 729f5f01b4 VS: Map Intel Fortran `/MP` flag for multi-processor compilation (#15990) 2016-03-29 08:45:00 -04:00
Kitware Robot 60de9b8a4f CMake Nightly Date Stamp 2016-03-29 00:01:05 -04:00
Geoff Viola 36ad8dd440 GHS: Implement link flags and dirs for non-target groups (#16029) 2016-03-28 11:46:46 -04:00
Brad King c69ed0a884 Merge topic 'only_change_timeout_once'
06b7f5d2 CTest: Only apply the secondary test timeout once
2016-03-28 09:25:40 -04:00
Kitware Robot aa9227aa4d CMake Nightly Date Stamp 2016-03-28 00:01:04 -04:00
Kitware Robot 6732749e5b CMake Nightly Date Stamp 2016-03-27 00:01:04 -04:00
Kitware Robot 9b5652846f CMake Nightly Date Stamp 2016-03-26 00:01:10 -04:00
Kitware Robot 484d7ca0e0 CMake Nightly Date Stamp 2016-03-25 00:01:06 -04:00
Brad King 64130a7e79 CMake 3.5.1 2016-03-24 09:56:42 -04:00
Brad King 6d36fc8341 Merge topic 'fix-variable_watch-reallocation'
c6104028 Avoid occasional use-after-free when a variable watch is executed
2016-03-24 08:49:46 -04:00
Brad King 917d49ed93 Merge topic 'cmake-depend-in-project-only'
b06e17da Help: Add notes for topic 'cmake-depend-in-project-only'
52540245 Tests: Add test for CMAKE_DEPENDS_IN_PROJECT_ONLY variable
b1e1aa1e Makefile: Optionally scan only source and build trees for dependencies
2016-03-24 08:49:43 -04:00
Brad King 5b2acf6c1c Merge topic 'vs-startup-project'
ad140c6e VS: Put ALL_BUILD in the PREDEFINED_TARGETS_FOLDER
f069be05 VS: Fix default target support for targets nested inside a folder
c05ea485 VS: Improve unit test macros
78ec0461 VS: Add option to choose the `.sln` startup project (#15578)
2016-03-24 08:49:41 -04:00
Kitware Robot 02166c33db CMake Nightly Date Stamp 2016-03-24 00:01:08 -04:00
Brad King 277b7567f7 Merge branch 'fix-variable_watch-reallocation' into release 2016-03-23 16:18:08 -04:00
Yves Frederix c610402825 Avoid occasional use-after-free when a variable watch is executed
Re-lookup a variable value when an associated VariableWatch is executed
in cmMakefile::GetDefinition.

This fixes a problem with 'def' sometimes becoming invalid due to memory
reallocation inside an std::vector. In this case, the problem was that
if the call to VariableAccessed actually executed a callback function,
the internal state of the makefile has changed due to the associated
function scope being pushed. This in turn implies that a new
cmDefinitions instance was pushed in cmMakefile::VarTree. As
cmLinkedTree is based on an std::vector, this push can have triggered
reallocation of its internal memory buffer. However, as the value of
'def', which was computed on method entry, actually points to a property
of one of the cmDefinitions instances in cmMakefile::VarTree,
reallocation can invalidate the value of 'def' so that it cannot simply
be returned at the end of the function. The solution implemented here is
to simply lookup the value of 'def' again.
2016-03-23 16:17:36 -04:00
Taylor Braun-Jones ad140c6e1b VS: Put ALL_BUILD in the PREDEFINED_TARGETS_FOLDER 2016-03-23 13:22:15 -04:00
Taylor Braun-Jones f069be0548 VS: Fix default target support for targets nested inside a folder
It's not actually the first target in a `.sln` file that is treated as
the default startup project, but rather the first fully defined target.
2016-03-23 13:22:15 -04:00
Zack Galbreath 06b7f5d2ca CTest: Only apply the secondary test timeout once
This commit fixes a bug in the implementation of the test property
TIMEOUT_AFTER_MATCH.  The new timeout value was being applied
every time a line was output by the test after the match had been
encountered.  Now the new timeout value is only set once.

This commit also improves some output formatting related to this
property.
2016-03-23 12:09:41 -04:00
Brad King 405766757c Merge topic 'use-cmXMLWriter'
51465da1 CPack/IFW: port to cmXMLWriter
754485af cmExtraEclipseCDT4Generator: port to cmXMLWriter
c45671b0 cmGlobalKdevelopGenerator: port to cmXMLWriter
dcdc270e cmExtraCodeLiteGenerator: port to cmXMLWriter
27e09764 cmExtraCodeBlocksGenerator: port to cmXMLWriter
d7407621 cmXMLWriter: add Doctype() method
dd27e313 cmXMLWriter: overload Element() method for empty elements
2016-03-23 11:19:19 -04:00
Daniel Pfeifer 51465da1ec CPack/IFW: port to cmXMLWriter 2016-03-23 11:18:16 -04:00
Daniel Pfeifer 754485afff cmExtraEclipseCDT4Generator: port to cmXMLWriter 2016-03-23 11:18:15 -04:00
Daniel Pfeifer c45671b0f1 cmGlobalKdevelopGenerator: port to cmXMLWriter 2016-03-23 11:18:15 -04:00
Kitware Robot 38caf1bb74 CMake Nightly Date Stamp 2016-03-23 00:01:06 -04:00
Brad King 6201c1a6ce Merge topic 'timeout_after_match'
de7afd29 Help: Add notes for topic 'timeout_after_match'
993e48d0 CTest: Optionally use a secondary test timeout after matching output
2016-03-22 16:09:28 -04:00
Attila Krasznahorkay b1e1aa1e6a Makefile: Optionally scan only source and build trees for dependencies
Add a `CMAKE_DEPENDS_IN_PROJECT_ONLY` variable to activate the behavior.
2016-03-22 16:04:15 -04:00
Zack Galbreath 993e48d045 CTest: Optionally use a secondary test timeout after matching output
Allow a test N seconds to complete after we detect a matching line in
its output.  Activate this behavior with a new TIMEOUT_AFTER_MATCH test
property.
2016-03-22 11:17:55 -04:00
Brad King 41c17c1d2e Merge topic 'ghs-try_compile'
bf3e76d2 GHS: Fix try_compile (#15975)
2016-03-22 11:15:41 -04:00
Brad King 2f9e6551c0 Merge topic 'ninja-directory-targets'
9ead71df Help: Add notes for topic 'ninja-directory-targets'
e9bf8ec8 Ninja: Add test for `$subdir/all` targets
ca575fe9 Ninja: Add `$subdir/all` targets
2016-03-22 11:15:38 -04:00
Davy Durham 78ec046130 VS: Add option to choose the `.sln` startup project (#15578)
Add a `VS_STARTUP_PROJECT` directory property to specify the project
that should be placed first in the `.sln` file so that it will be
selected as the default startup project.

Co-Author: Taylor Braun-Jones <taylor.braunjones@avigilon.com>
2016-03-22 07:57:00 -04:00
Kitware Robot 1449b11e19 CMake Nightly Date Stamp 2016-03-22 00:01:06 -04:00
Geoff Viola bf3e76d214 GHS: Fix try_compile (#15975) 2016-03-21 10:35:01 -04:00
Daniel Pfeifer dcdc270eeb cmExtraCodeLiteGenerator: port to cmXMLWriter 2016-03-21 10:11:53 -04:00
Daniel Pfeifer 27e0976453 cmExtraCodeBlocksGenerator: port to cmXMLWriter 2016-03-21 10:11:53 -04:00
Daniel Pfeifer d740762181 cmXMLWriter: add Doctype() method 2016-03-21 10:11:53 -04:00