Commit Graph

31123 Commits

Author SHA1 Message Date
Alex Turbov efe139d1b8 cmake_host_system_information: Can run fallback scripts 2021-08-20 09:35:12 -04:00
Alex Turbov 1e65e4a6e5 cmake_host_system_information: Can read /etc/os-release file 2021-08-20 09:35:09 -04:00
Alex Turbov 346f3de005 Refactor: Deduplicate code for VS_nn_DIR keys processing 2021-07-30 03:40:13 +03:00
Alex Turbov f9947ec9e3 Refactor: Use string view 2021-07-30 03:40:12 +03:00
Alex Turbov 69d3fcf2c8 Refactor: bool GetValue(..., string&)optional<string> GetValue(...)
Also, split `GetValue()` into 2 overloads:

- one used to get documented keys
- the other (different signature) to get `VS_nn_DIR` keys
2021-07-30 03:27:16 +03:00
Alex Turbov d6b4982697 Refactor: Move module private functions on top 2021-07-28 04:38:26 +03:00
Alex Turbov d6299d9941 Refactor: Run CPU/OS/Memory tests once on first run 2021-07-28 02:18:24 +03:00
Kitware Robot c15bb6f8b8 CMake Nightly Date Stamp 2021-07-27 00:01:08 -04:00
Brad King 865e266a14 Merge topic 'update-kwsys'
4977184128 Merge branch 'upstream-KWSys' into update-kwsys
7fc3f7001a KWSys 2021-07-26 (d5fd6ca2)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6391
2021-07-26 12:10:23 -04:00
Brad King 4977184128 Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2021-07-26 (d5fd6ca2)
2021-07-26 10:17:18 -04:00
Brad King 0d987bbd88 Merge topic 'refactor-target-export'
e8e19ed8f2 Refactor export file generator inteface
55e4753bbb Refactor cmTargetExport removing InterfaceIncludeDirecories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6370
2021-07-26 09:44:15 -04:00
Brad King 00cbc4cff7 Merge topic 'autouic-header-depends'
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6380
2021-07-26 09:34:52 -04:00
Brad King 98d813b92c Merge topic 'autouic-header-depends' into release-3.21
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6380
2021-07-26 09:34:51 -04:00
Brad King 2f7c4a788c Merge topic 'autogen-deps' into release-3.21
4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6381
2021-07-26 09:33:56 -04:00
Kitware Robot ffbd3bb42f CMake Nightly Date Stamp 2021-07-26 00:01:14 -04:00
Kitware Robot a87c54aba3 CMake Nightly Date Stamp 2021-07-25 00:01:08 -04:00
Kitware Robot acb068b0f0 CMake Nightly Date Stamp 2021-07-24 00:01:12 -04:00
Joerg Bornemann 4bda03370d AutoGen: Fix needless compilation of mocs_compilation.cpp
For an AUTOMOC'ed target foo, when depfiles are used, there are the
following dependencies:

foo_autogen -> foo_autogen/timestamp
foo_autogen/mocs_compilation.cpp -> foo_autogen/timestamp

The first is used to trigger AUTOGEN.
The second erroneously triggers a recompilation of
mocs_compilation.cpp when any source file of target foo is touched.

Remove the latter dependency and replace it with an order-only
dependency from foo_autogen/mocs_compilation.cpp to
foo_autogen_timestamp_deps.

That is achieved by making mocs_compilation.cpp or its
per-configuration variants byproduct(s) of the timestamp file.

Fixes: #22338
2021-07-23 15:47:28 +02:00
Brad King ca2c63f423 Merge topic 'nmc-target-objects'
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6371
2021-07-23 09:39:26 -04:00
Brad King e06c60f7e9 Merge topic 'nmc-target-objects' into release-3.21
cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6371
2021-07-23 09:39:25 -04:00
Alexey Edelev e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files
We could not rely on .ui files when generating the ninja rules
for the generated UI header files. .ui files might be added to the
target sources but never processed by AUTOUIC afterward, since UI
header files are never included in a source code. Instead of adding
dependency rules based on the .ui files, this approach scans
non-generated source files for includes of the UI header files,
as AUTOUIC does. This gives the consistent set of UI header files
at configure time, that could be used to generate byproducts rules
for the AUTOUIC. Also, the path to the generated UI header file depends
not on the .ui file location but on the include line is used in source
files.

Fixes: #16776
2021-07-23 15:37:31 +02:00
Kitware Robot f7a3031b7d CMake Nightly Date Stamp 2021-07-23 00:01:08 -04:00
Eugene Shalygin e8e19ed8f2 Refactor export file generator inteface
Replace cmTargetExport with const cmGeneratorTarget to allow recursive
processing of exported targets and their link dependencies.
2021-07-22 13:08:58 +02:00
Eugene Shalygin 55e4753bbb Refactor cmTargetExport removing InterfaceIncludeDirecories
Because of this property in the cmTargetExport struct, exporting targets
is not uniform: top-level ones have to be dealt with via the
cmTargetExport objects, while all linked ones are cmGeneratorTarget
objects. Let's pass this additional includedirectories via a special
target property making handling exported targets uniform.
2021-07-22 13:08:58 +02:00
Kitware Robot 26a76cf46d CMake Nightly Date Stamp 2021-07-22 00:01:11 -04:00
Brad King cb777dd81e Ninja Multi-Config: Restore TARGET_OBJECTS support in cross-configs
Since commit 2ae72ef74b (Xcode: Enable multi-arch TARGET_OBJECTS genex
in [INTERFACE_]LINK_LIBRARIES, 2021-05-26, v3.21.0-rc1~126^2) the
TARGET_OBJECTS genex, when referenced for linking, is now evaluated with
EvaluateForBuildsystem enabled.  This causes the object file paths to be
computed with a buildsystem-specific placeholder for the configuration.

This is normally fine because the placeholder will be evaluated by the
native buildsystem tool using the proper configuration.  However, the
Ninja Multi-Config generator's `${CONFIGURATION}` placeholder may not
have the correct value for cross-config object files.  Switch back to
using the per-config location of each object file for this generator.

Fixes: #22436
2021-07-21 11:46:15 -04:00
Brad King b8021454ce Merge topic 'message-color'
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6369
2021-07-21 11:34:05 -04:00
Brad King e98bfa484f Merge topic 'message-color' into release-3.21
c7a8c9c811 cmMessenger: Revert to non-color messages on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6369
2021-07-21 11:34:04 -04:00
Brad King 797aa4c410 Merge topic 'toolchain-CMP0126' into release-3.21
144be54dd3 try_compile: Propagate CMP0126 to the generated test project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6366
2021-07-21 11:31:29 -04:00
Brad King 992467c30c Merge topic 'toolchain-CMP0126'
144be54dd3 try_compile: Propagate CMP0126 to the generated test project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6366
2021-07-21 11:31:29 -04:00
Kitware Robot dee0b88e77 CMake Nightly Date Stamp 2021-07-21 00:01:11 -04:00
Brad King 83c8272280 cmGeneratorExpressionNode: Factor out local variable for global generator 2021-07-20 14:52:01 -04:00
Brad King c7a8c9c811 cmMessenger: Revert to non-color messages on Windows
Since commit 0a0a0f8a74 (cmMessenger: Color messages to terminal by
type, 2021-05-18, v3.21.0-rc1~146^2) the message output no longer goes
through our custom streambuf on Windows that converts output encoding.
This can cause messages to be printed with the wrong encoding in a
Windows Console.  It also causes messages to have a mix of LF and CRLF
newlines because `stderr` converts LF to CRLF but our custom streambuf
does not.

Revert to using just `cerr` for messages on Windows.  Another approach
will be needed to achieve color output on Windows later.

Fixes: #22444
2021-07-20 13:30:11 -04:00
Brad King c9d440fcaa Merge topic 'find_library_usable_from_script_mode'
aa3ab3eb92 find_library: Infer library prefix and suffix when in script mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6338
2021-07-20 11:48:17 -04:00
Brad King 6cd0908072 Merge topic 'autogen-ui-header-depends'
9cebdbec77 AUTOUIC: Fix cyclic dependency between generated UI headers and timestamp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6359
2021-07-20 11:46:01 -04:00
Brad King 144be54dd3 try_compile: Propagate CMP0126 to the generated test project
Set policy CMP0126 to the value used in the calling project.
It may affect toolchain file behavior.
2021-07-20 09:47:02 -04:00
Kitware Robot 6521cededd CMake Nightly Date Stamp 2021-07-20 00:01:10 -04:00
Alexey Edelev 9cebdbec77 AUTOUIC: Fix cyclic dependency between generated UI headers and timestamp
Once the generated UI headers are created by UIC they also are involved
into processing in next run on ninja.  Autogen adds `ui_*.h` files to
the deps file `ui_*.h` and this cause timestamp start depend on `ui_*.h`.
Meanwhile `ui_*.h` depend on timestamp because of the explicit rules
added by commit 1265c65b33 (AUTOUIC: Collect ui header files for Ninja
generator, 2021-02-18, v3.21.0-rc1~600^2).  Avoid adding `ui_*.h` to
deps file at second ninja run.

Fixes: #16776
2021-07-19 13:28:16 -04:00
Brad King 4ff651eb52 Merge topic 'cmake-presets-no-binary-dir-no-s' into release-3.21
aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6358
2021-07-19 12:59:01 -04:00
Brad King a9900c8364 Merge topic 'cmake-presets-no-binary-dir-no-s'
aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6358
2021-07-19 12:59:01 -04:00
Robert Maynard aa3ab3eb92 find_library: Infer library prefix and suffix when in script mode
This aligns `find_library` with the documentation that states it
can be called from script mode. This is done by infering the
proper prefix and suffix values when `find_library` is called
when the `CMAKE_FIND_LIBRARY*` are not set. This also means that
`find_library` won't produce obscure error messages about unset
definitions.

Fixes: #22027
2021-07-19 12:55:18 -04:00
Brad King 1f6e1a2d78 Merge topic 'vs2022'
0c7f918fb1 VS: Update Visual Studio 17 2022 generator for Preview 2
1ac1436b25 VS: Fix `/sourceDependencies` flag table entries for v143
919fc7fd5f VS: Remove broken EnableASAN entry from flag table for v143
3f19847b28 VS: Remove empty ExternalWarningLevel entry from flag table for v143
ccb6083cbe VS: Remove empty LanguageStandard entries from flag table for v143
c167de7e70 VS: Remove empty ConformanceMode entry from flag table for v143
993d706a17 VS: Populate `/JMC-` flag table entry for v143
a070d87e08 VS: Populate `-Qspectre-` flag table entry for v143
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Egor Pugin <egor.pugin@gmail.com>
Merge-request: !6350
2021-07-19 12:41:20 -04:00
Kitware Robot fabbb69e69 CMake Nightly Date Stamp 2021-07-19 00:01:13 -04:00
Kitware Robot 0094d12ead CMake Nightly Date Stamp 2021-07-18 00:01:07 -04:00
Kitware Robot 7f7e7485f3 CMake Nightly Date Stamp 2021-07-17 00:01:10 -04:00
Kyle Edwards aa874dc609 CMakePresets.json: Fix expansion issue with empty binaryDir
When resolving binaryDir into a full path from a relative path, we
forgot to check if binaryDir is altogether empty, causing empty
binaryDir's to resolve to the source directory. Fix this.

Fixes: #22434
2021-07-16 10:25:40 -04:00
Kitware Robot 4e17e90988 CMake Nightly Date Stamp 2021-07-16 00:01:08 -04:00
Brad King 0c7f918fb1 VS: Update Visual Studio 17 2022 generator for Preview 2
In particular, update to toolset `v143`.

Fixes: #22339
2021-07-15 13:12:55 -04:00
Kitware Robot 769c539d59 CMake Nightly Date Stamp 2021-07-15 00:01:14 -04:00
Brad King ff7a2e37bf CMake 3.21.0 2021-07-14 10:10:23 -04:00