1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Commit Graph

1647 Commits

Author SHA1 Message Date
Vitaly Stakhovsky
5e8fa0b7bc Source: Minor code improvements 2021-05-11 11:20:04 -04:00
Josef Angstenberger
5950e54325 Source: Fix typos and spelling in comments 2021-05-07 17:00:18 +02:00
Marc Chevrier
46896d98bb foreach(): loop variables are only available in the loop scope
Fixes: #20553
2021-04-28 19:44:25 +02:00
Andrew Gilewsky
7c4c4f1406 Treat '.ixx' and '.cppm' files as C++ sources
These extensions are used by convention for C++ modules and interface
units with MSVC.
2021-03-22 11:58:44 -04:00
Brad King
ab3485d15b Merge topic 'autogen-cmp0116-fix'
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
2021-02-24 09:44:59 -05:00
Kyle Edwards
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation 2021-02-23 09:14:31 -05:00
Brad King
58ea0d1255 Add deprecation warnings for policies CMP0081 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.13 and below to encourage projects to port
away from setting policies to OLD.
2021-02-10 09:25:32 -05:00
Brad King
8387aa20f2 Merge topic 'issue-19198'
255df8622b file(GENERATE): Support new line style

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !5649
2021-02-02 08:53:07 -05:00
Asit Dhal
255df8622b file(GENERATE): Support new line style
Fixes: #19198
2021-02-01 01:38:19 +01:00
Brad King
e32818dd76 cmInstallGenerator: Add backtrace to all install generators 2021-01-28 12:47:58 -05:00
Ben Boeckel
cdfc4e3195 clang-tidy: fix readability-qualified-auto warnings 2021-01-27 08:45:45 -05:00
Brad King
b7485c98a0 Merge topic 'trace_expand_bracket'
e6e7f2cab9 cmMakefile: Don't expand bracket arguments in --trace-expand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5687
2021-01-12 10:20:26 -05:00
Raul Tambre
e6e7f2cab9 cmMakefile: Don't expand bracket arguments in --trace-expand
Bracket arguments are literal and shouldn't be expanded.

Fixes #21671.
2021-01-11 19:54:18 +02:00
Brad King
05f4248e3d Merge topic 'cpp-modules'
39cbbb59a5 ninja: add experimental infrastructure to generate gcc-format modmap files
791b4d26d6 ninja: add experimental infrastructure to generate modmap files with dyndep
4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning
f814d3b3c6 cmNinjaTargetGenerator: use $OBJ_FILE for the object
b0fc2993e1 Treat the '.mpp' file extension as C++ code
988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors
dacd93a2db ninja: De-duplicate version numbers required for ninja features
533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Shannon Booth <shannon.ml.booth@gmail.com>
Merge-request: !5562
2021-01-07 08:26:28 -05:00
Ben Boeckel
b0fc2993e1 Treat the '.mpp' file extension as C++ code
This is the extension required in build2 for C++ module support.
2021-01-05 09:29:18 -05:00
Oleksandr Koval
209daa20b2 Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
2021-01-05 14:32:36 +02:00
Asit Dhal
c3385dd8bd file(GENERATE): Support options to manipulate file permissions
Fixes: #15653
2020-12-21 12:16:16 +01:00
Brad King
15467f12f7 cmLocalGenerator: Adopt custom target 'force' output name generation 2020-12-15 07:00:53 -05:00
Brad King
d29da8ed3e cmMakefile: Simplify custom target 'force' output name generation
Remove unnecessary check of policy CMP0049.  The policy can never
trigger on our internally-generated name because it has no variable
references.

The rename in commit 0ed5ce4cd8 (cmTarget: Rename AddSource method for
backward compatibility., 2014-03-17, v3.1.0-rc1~688^2~17) made it look
like this code path depended on CMP0049.  Then commit 0e1faa28cb
(cmMakefile: Separate custom command setup from actual creation,
2019-09-14, v3.16.0-rc1~85^2) and commit ea1bed34b2 (cmMakefile: Extract
utilities used for creation of custom commands, 2019-09-21,
v3.16.0-rc1~52^2~1) built additional infrastructure to thread that
dependence through the call stack.  Remove it all.
2020-12-15 07:00:52 -05:00
Deniz Bahadir
6624b65b3f GENERATED prop: Add implementation for policy CMP0118 being set to NEW
* Adding implementation for policy CMP0118 being set to `NEW`.
* Adding new tests for policy CMP0118 being set to `NEW`.
* Checking the `GENERATED` property with `get_source_file_property` or
  `get_property` now always returns exactly `1` or `0`. No other values
  will be returned. Note, that this is a backwards-incompatible change,
  even when policy CMP0118 is unset or set to `OLD`.
* Additionally, as `get_source_file_property` and `get_property` now
  always check if a source-file was marked globally visible, even when
  CMP0118 is unset or set to `OLD`, they possibly return `1` where they
  might have returned `0` before the changes introduced by this commit.
  Note, that this is a backwards-incompatible change, even when policy
  CMP0118 is unset or set to `OLD`.
* As a consequence, the tests for policy CMP0118 being unset or set to
  `OLD` got slightly adjusted, too, to reflect these changes in
  behavior.
2020-11-24 18:16:51 +01:00
Vitaly Stakhovsky
f6e7d5f3a0 Reduce the scope of temporary cmProp variables and other improvements 2020-11-05 11:07:39 -05:00
Asit Dhal
03ad0e61c1 configure_file: Add option for user defined permissions
User defined permissions and options to copy permissions are
implemented.

Fixes: #20866
2020-10-24 12:00:47 +02:00
Cengizhan Pasaoglu
bd705788f6 Constify some code as suggested by clang-tidy 2020-10-20 00:04:04 +03:00
Brad King
3b9492204a Merge topic 'fix-refactor-generator-configs'
b9cb1d324d Fix regression in test/install/package configuration selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5381
2020-10-16 09:19:48 -04:00
Brad King
b9cb1d324d Fix regression in test/install/package configuration selection
In commit 7a969fe21d (cmMakefile: Refactor API to better handle empty
config values, 2020-06-30, v3.19.0-rc1~567^2), calls to
`GetGeneratorConfigs` that pass `OnlyMultiConfig` only want to get any
configurations listed if the generator is multi-config.  Fix the
implementation to actually do that.

Fixes: #21316
2020-10-15 10:53:09 -04:00
Brad King
2b218883cd Add deprecation warnings for policies CMP0075 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.12 and below to encourage projects to port
away from setting policies to OLD.
2020-10-13 14:36:00 -04:00
Brad King
953f4d503d cmMakefile: Consolidate CreateGenerated{Outputs,Byproducts}
The implementations of these two methods are now identical,
so combine them.
2020-10-08 12:20:34 -04:00
Brad King
0090a11a42 cmLocalGenerator: Migrate custom command output lookup from cmMakefile
Since commit 777ceaea94 (cmMakefile: Delay custom command creation,
2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at
generate time.  Therefore we do not need to look up what source file
holds the custom command producing a given output until generate time.
2020-10-08 12:20:33 -04:00
Brad King
26464da5d3 cmMakefile: Drop unnecessary custom command APPEND check
Since commit 777ceaea94 (cmMakefile: Delay custom command creation,
2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations
at generate time.  This includes the append-to-non-existing-command
check, so we do not need it at configure time.
2020-10-08 12:20:33 -04:00
Oleksandr Koval
e614528ad1 cmListFileCache: Make cmListFileFunction a shared pointer
Passing cmListFileFunction everywhere by-value involves big overhead.
Now cmListFileFunction stores std::shared_ptr to the underlying data.
2020-10-01 14:28:03 +03:00
Brad King
e8b0359a43 cmake_language: Add signature to DEFER calls to later times
Fixes: #19575
2020-09-29 17:12:33 -04:00
Brad King
1a5bf8245e cmMakefile: Clarify name of internal list file run method 2020-09-29 06:03:15 -04:00
Brad King
07c1bdda3d cmMakefile: Replace GetExecutionFilePath with the top of the Backtrace
The execution file path stack and the backtrace stack are kept in sync.
At all call sites of `GetExecutionFilePath`, the execution file path
matches the path in the context at the top of the backtrace stack.
2020-09-28 09:49:08 -04:00
Brad King
727ed0c403 cmMakefile: Simplify ExpandArguments signature
The only call sites that pass the explicit file name argument are in
function blocker `ArgumentsMatch` methods for `function` and `macro`.
We already ensure that they are balanced within a file scope, and the
RAII helpers `BuildsystemFileScope` and `ListFileScope` ensure that the
backtrace and execution list file stacks unwind to the matching level.
Therefore we can assume that the file name where we are checking for
matching arguments matches starting file name where those arguments
first appeared, and do not need to pass it explicitly.
2020-09-28 09:49:08 -04:00
Brad King
0100a4943e cmMakefile: Remove now-unused overload of GetBacktrace 2020-09-28 09:49:08 -04:00
Brad King
68af831505 cmMakefile: Inline GetExecutionContext at call sites
The method only had one line, and its implementation is more clear
at the call sites than the method name.
2020-09-28 09:49:07 -04:00
Brad King
280f3918f3 cmMakefile: Simplify GetExecutionContext implementation
This method takes the function name and line from the top of the
current backtrace and then gets the file path from the state's
`GetExecutionListFile`.  This exactly matches what the `cmMakefileCall`
constructor does to create the top of the current backtrace anyway,
so we can just take that directly.
2020-09-28 09:49:07 -04:00
Oleksandr Koval
62d7acc6d4 cmCommandArgumentParserHelper: rework input handling
Old implementation uses involved Flex input management technique that
requires usage of obsolete YY_INPUT macro. This causes a lot of useless
allocations and byte-by-byte scanning. New implementation avoids those
hacks, it uses yy_scan_string() API to setup Flex input. Also it fixes
reporting of syntax error position and corresponding tests.
2020-09-09 15:49:35 +03:00
Brad King
b63f508e4d Merge topic 'GetExecutionListFile-by-ref'
879bd7fd9c cmStateSnapshot: Return const reference from GetExecutionListFile()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5186
2020-09-08 11:18:28 -04:00
Oleksandr Koval
879bd7fd9c cmStateSnapshot: Return const reference from GetExecutionListFile() 2020-09-04 00:17:32 +03:00
Vitaly Stakhovsky
1380b43764 Refactor: Use cmToCStr() 2020-09-03 11:36:54 -04:00
Vitaly Stakhovsky
11425041f0 cmMakefile::GetDefinition: return cmProp 2020-09-02 07:27:32 -04:00
Raul Tambre
27a912193b file(GENERATE): Add TARGET argument
Adds TARGET argument to file(GENERATE) to make resolving generator expressions
requiring a target possible.

Implements #21101, fixes #21074.
2020-08-20 17:41:52 +03:00
Kyle Edwards
491dddfbde Bootstrap: Add support for Ninja 2020-08-10 14:40:17 -04:00
Vitaly Stakhovsky
f37c14e930 Source: use cmNonempty() 2020-07-28 08:31:31 -04:00
Vitaly Stakhovsky
7156911242 cmIsOn: add overload accepting const std::string* 2020-07-14 08:22:24 -04:00
Brad King
7160a2b9d9 Merge topic 'imported-local-target-alias'
7b0f6508a0 ALIAS targets: Non-global aliases must be propagated to sub-directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5002
2020-07-13 07:53:01 -04:00
Marc Chevrier
7b0f6508a0 ALIAS targets: Non-global aliases must be propagated to sub-directories
Fixes: #20942
2020-07-11 16:59:50 +02:00
Brad King
a4cfc7d03c Merge topic 'refactor-generator-configs'
7a969fe21d cmMakefile: Refactor API to better handle empty config values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4957
2020-07-06 09:28:11 -04:00
Robert Maynard
7a969fe21d cmMakefile: Refactor API to better handle empty config values 2020-07-03 07:43:18 -04:00