Commit Graph

26977 Commits

Author SHA1 Message Date
Sebastian Holtermann
e91bfe440c cmMakefile: Let AddDefinition accept a value as cm::string_view
This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value
argument instead of a `const char *`.

Benefits are:
- `std::string` can be passed to `cmMakefile::AddDefinition` directly without
  the `c_str()` plus string length recomputation fallback.
- Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at
  compile time.

In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid
`std::string::c_str` calls and the `std::string` is passed directly.
Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might
be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
2019-07-24 11:11:25 +02:00
Sebastian Holtermann
f2ba968ef2 cmMakefile: Simplify and rename AddDefinitionBool
This simplifies the `cmMakefile::AddDefinition` method with bool value
overload to call the string based `cmMakefile::AddDefinition` method
with either an "ON" or "OFF" string.
Also the method is renamed to `cmMakefile::AddDefinitionBool`
2019-07-24 11:11:25 +02:00
Sebastian Holtermann
9b5cc42531 cmDefinitions: Remove const char* based Set method
- Removes `cmDefinitions::Set` method overload that takes a `const char*`
  value argument.
- Updates calls to `cmDefinitions::Set` to use the `cm::string_view` based
  version instead.
2019-07-24 11:11:25 +02:00
Sebastian Holtermann
e268840c0a cmDefinitions: Add Unset and cm::string_view based Set methods
- The `cmDefinitions::Def` struct is simplified by removing an unused
  constructor and the `std_string` type definition.  The std::string value
  becomes a member variable instead of being derived from.

- The `cmDefinitions::Unset` method is added that unsets a definition.
  It has the same functionality as calling `cmDefinitions::Set` with a
  `nullptr` value argument,

- The `cmDefinitions::Set` method gets an overloaded version that takes a
  `cm::string_view` as value argument.

- The originl `cmDefinitions::Set` method with `const char*` argument is
  refactored to either call the `cm::string_view` based `cmDefinitions::Set`
  overload or `cmDefinitions::Unset`, depending on whether the value
  `const char*` is a nullptr (`Unset`) or not (`Set`).
2019-07-24 11:11:25 +02:00
Sebastian Holtermann
451fd329a8 cmDefinitions: Cleanups 2019-07-24 11:11:25 +02:00
Kitware Robot
1f618fae4d CMake Nightly Date Stamp 2019-07-24 00:01:09 -04:00
Brad King
59b3000c08 Merge topic 'parsers-bison-3.3'
8f0b3f92d5 LexerParser: Regenerate parsers with bison 3.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3588
2019-07-23 07:33:23 -04:00
Brad King
dcd4d3e9bf Merge topic 'cmHasLiteralPrefix_cm_string_view'
301f5356fd cmAlgorithms: Make cmHasPrefix and cmHasSuffix cm::string_view based

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !3583
2019-07-23 07:32:30 -04:00
Brad King
5396c5fce4 Merge topic 'make-imported-targets-more-equal'
680a3c63bb target_*: Allow setting INTERFACE properties of UNKNOWN IMPORTED targets
62b5d1e4ad cmTargetPropCommandBase: Order target type condition by order in enum

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3581
2019-07-23 07:30:53 -04:00
Brad King
6f476a4169 Merge topic 'command-refactoring3'
dfaa87f1b3 cmState: Support BuiltinCommands as free functions
28f2d12a05 cmCommand: De-virtualize function InvokeInitialPass
de77d355ac cmState: Add scripted commands by value
0101ace131 cmUnexpectedCommand: Replace with lambda expression
015001aaf1 cmState: Hold commands by value
1eebc29563 cmCommand: deprecate functions GetMakefile and SetError

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3574
2019-07-23 07:29:11 -04:00
Kitware Robot
63dfa74f5f CMake Nightly Date Stamp 2019-07-23 00:01:08 -04:00
Avraham Shukron
680a3c63bb target_*: Allow setting INTERFACE properties of UNKNOWN IMPORTED targets
Extend the change made by commit fe4b25ec2f (Teach target_* commands to
set INTERFACE properties of IMPORTED targets, 2017-09-18,
v3.11.0-rc1~433^2~2) to work with imported targets of type `UNKNOWN`.

Fixes: #19434
2019-07-22 10:23:39 -04:00
Sebastian Holtermann
301f5356fd cmAlgorithms: Make cmHasPrefix and cmHasSuffix cm::string_view based
Make `cmHasPrefix`, `cmHasSuffix` and `cmStripSuffixIfExists` accept
arguments as `cm::string_view` instead of `const std::string&`.
This lets them accept literal strings without having to allocate a temporary
`std::string`.
Add variants of `cmHasPrefix`, `cmHasSuffix` and `cmStripSuffixIfExists` that
accept a single character as second argument.
2019-07-22 16:04:22 +02:00
Regina Pfeifer
dfaa87f1b3 cmState: Support BuiltinCommands as free functions 2019-07-22 15:27:56 +02:00
Avraham Shukron
62b5d1e4ad cmTargetPropCommandBase: Order target type condition by order in enum
This improves readability.
2019-07-22 08:53:52 -04:00
Brad King
8f0b3f92d5 LexerParser: Regenerate parsers with bison 3.3
Run `Utilities/Scripts/regenerate-parsers.bash`.
2019-07-22 08:45:40 -04:00
Brad King
dbffd2f4d5 Merge topic 'refactor-processhandler'
ae2cfc4bd8 Refactor: Break cmCTestTestHandler::ProcessHandler() into smaller functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3580
2019-07-22 08:21:26 -04:00
Brad King
827b498a02 Merge topic 'static-library-flags'
59f2aa63e4 Swift: fix static library handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3576
2019-07-22 08:18:43 -04:00
Brad King
aaf3859e0a Merge topic 'refactor-usage-requirements'
2682714a3f cmGeneratorTarget: Refactor usage requirement genex evaluation
3cbc15773f cmGeneratorTarget: Move static functions to anonymous namespace
33494a507d cmGeneratorTarget: Order usage requirement processing logic consistently
c131e62f7b cmGeneratorTarget: Remove unnecessary copy to local variable
fab72918c9 cmGeneratorTarget: Remove unused member of internal class
95d3598e04 cmGeneratorExpressionDAGChecker: Avoid const_cast

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Marc Chevrier <marc.chevrier@gmail.com>
Merge-request: !3578
2019-07-22 08:17:41 -04:00
Craig Scott
9e42075498 Merge topic 'cpack-install-scripts'
5f96601675 CPack: Introduce CPACK_INSTALL_SCRIPTS variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3531
2019-07-22 07:04:00 -04:00
Craig Scott
f4131e4e1b Merge topic 'feature/message-indent'
5f6fd917a3 message(): Control indentation via CMAKE_MESSAGE_INDENT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3464
2019-07-22 07:02:50 -04:00
Kitware Robot
f3bbbb42f1 CMake Nightly Date Stamp 2019-07-22 00:01:06 -04:00
Alex Turbov
5f96601675 CPack: Introduce CPACK_INSTALL_SCRIPTS variable
The singular name `CPACK_INSTALL_SCRIPT` has existed but was not linked
from the CPack documentation.  Also, it supported multiple values and
should have had a plural name.  Add a plural-named alternative now.
If both `CPACK_INSTALL_SCRIPTS` and `CPACK_INSTALL_SCRIPT` are set then
ignore the latter with a warning.

Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
2019-07-22 02:01:44 +03:00
Regina Pfeifer
28f2d12a05 cmCommand: De-virtualize function InvokeInitialPass 2019-07-21 09:25:32 +02:00
Regina Pfeifer
de77d355ac cmState: Add scripted commands by value 2019-07-21 09:25:32 +02:00
Regina Pfeifer
0101ace131 cmUnexpectedCommand: Replace with lambda expression 2019-07-21 09:25:32 +02:00
Regina Pfeifer
015001aaf1 cmState: Hold commands by value 2019-07-21 09:25:32 +02:00
Daniel Pfeifer
1eebc29563 cmCommand: deprecate functions GetMakefile and SetError
Replace the members for the Makefile and the Error with a
cmExecutionStatus.  Re-implement GetMakefile and SetError based on that.

Both functions should be called directly on the cmExecutionStatus that is
passed to InitialPass.  This will help us make all Commands immutable and
remove the need for cloning.
2019-07-21 09:25:32 +02:00
Kitware Robot
82aa6941e9 CMake Nightly Date Stamp 2019-07-21 00:01:05 -04:00
Alex Turbov
5f6fd917a3 message(): Control indentation via CMAKE_MESSAGE_INDENT 2019-07-21 10:19:30 +10:00
Kitware Robot
0c6e27bff1 CMake Nightly Date Stamp 2019-07-20 00:01:11 -04:00
Kyle Edwards
ae2cfc4bd8 Refactor: Break cmCTestTestHandler::ProcessHandler() into smaller functions 2019-07-19 14:13:56 -04:00
Brad King
2682714a3f cmGeneratorTarget: Refactor usage requirement genex evaluation
Evaluate usage requirement generator expressions fully before entering
the processing loops.  This allows us to evaluate and collect all
entries up front and then have only one call to the loop over them.
This also allows `AddInterfaceEntries` to immediately evaluate the
generator expressions it synthesizes, which will enable later
optimization.
2019-07-19 13:38:30 -04:00
Brad King
3cbc15773f cmGeneratorTarget: Move static functions to anonymous namespace 2019-07-19 13:05:21 -04:00
Kyle Edwards
16bb46eaf3 Merge topic 'skip_regular_expression'
5dbd9c8583 Vim: Add SKIP_REGULAR_EXPRESSION test property to vim syntax file
407dd1a910 Help: Add documentation for SKIP_REGULAR_EXPRESSION test property
d7955d4e5d Tests: Create test for SKIP_REGULAR_EXPRESSION test property
4f1dec86a5 CTest: Add SKIP_REGULAR_EXPRESSION test property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3570
2019-07-19 12:14:27 -04:00
Brad King
573f1fc19b Merge topic 'command-final-action'
732dd344b9 cmCommand: remove FinalPass from interface
fbee46e262 cmVariableWatchCommand: Port away from FinalPass
360d415592 cmLoadCommandCommand: Port away from FinalPass
316e40baec cmInstallProgramsCommand: Port away from FinalPass
7bc88b9165 cmInstallFilesCommand: Port away from FinalPass
6a1a3763ee cmFLTKWrapUICommand: Port away from FinalPass
20169f0b8d cmExportLibraryDependenciesCommand: Port away from FinalPass
a74dad3bd3 cmMakefile: decouple FinalAction from cmCommand
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3562
2019-07-19 12:09:03 -04:00
Brad King
ca7ec2e188 Merge topic 'ctest-done-hash'
da79075c4d CTest: Generate Done.xml before calculating its hash

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3563
2019-07-19 12:02:53 -04:00
Betsy McPhail
da79075c4d CTest: Generate Done.xml before calculating its hash
Fixes: #19489
2019-07-19 12:00:30 -04:00
Brad King
f79e684678 Merge topic 'QCC-ninja-support'
8738e2584a cmGlobalNinjaGenerator: Use gnu compatible paths with QCC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3567
2019-07-19 12:00:12 -04:00
Brad King
a2daa3ef27 Merge topic 'modernize_std_unique_ptr'
3bed969dac cmMakefile: Modernize AddFunctionBlocker method to accept a std::unique_ptr
faacb90a13 cmELF: Modernize to use std::unique_ptr instead of new/delete

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3548
2019-07-19 11:59:04 -04:00
Brad King
6618cbf38a Merge topic 'vs-asmlist-dir'
c1fc6c80c7 VS: Place intermediate files in the "ASM List Location" next to objects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3569
2019-07-19 11:55:48 -04:00
Brad King
33494a507d cmGeneratorTarget: Order usage requirement processing logic consistently
Re-order logic in all `process*` methods so that they all evaluate
generator expressions at the beginning of their loops.
2019-07-19 09:58:12 -04:00
Brad King
c131e62f7b cmGeneratorTarget: Remove unnecessary copy to local variable 2019-07-19 09:58:12 -04:00
Brad King
fab72918c9 cmGeneratorTarget: Remove unused member of internal class 2019-07-19 09:58:12 -04:00
Brad King
95d3598e04 cmGeneratorExpressionDAGChecker: Avoid const_cast
Make a member mutable to avoid casting away const of a whole object.
2019-07-19 09:58:12 -04:00
Kitware Robot
ac000e29da CMake Nightly Date Stamp 2019-07-19 00:01:07 -04:00
Saleem Abdulrasool
59f2aa63e4 Swift: fix static library handling
Handle static libraries similar to shared libraries.  Do not pass along
the shared library flags raw as that will pass flags for the linker to
the driver which is incorrect.
2019-07-18 19:52:48 -07:00
Gabor Bencze
4f1dec86a5 CTest: Add SKIP_REGULAR_EXPRESSION test property 2019-07-18 11:52:05 -04:00
Brad King
c1fc6c80c7 VS: Place intermediate files in the "ASM List Location" next to objects
The `AssemblerListingLocation` setting in VS project files is meant for
intermediate files created during the build much like object files.
When the VS 7 generator was first under development, commit 49aebe6c99
(new arch, 2002-09-04) placed both object files and the ASM list
location in the same directory.  Later commit f9aef0e422 (Generator now
creates a separate intermediate files directory for each target,
2005-07-27) moved the object files to a per-target directory but the
ASM list location was not moved with them.  Move it now.

Fixes: #19480
2019-07-18 11:40:58 -04:00
Daniel Pfeifer
732dd344b9 cmCommand: remove FinalPass from interface 2019-07-18 17:35:43 +02:00