Commit Graph

30946 Commits

Author SHA1 Message Date
Alex Richardson
115ff6a347 cmELF: Include the ELF parsing code unconditionally
Now that the ELF definitions are provided on all platforms there is no
need to keep the CMake_USE_ELF_PARSER option.
2021-06-24 10:57:51 -04:00
Alex Richardson
5dfa3ddbe5 cmELF: Allow building without system ELF headers
Use ELF headers vendored in `Utilities/cmelf` to get the ELF constants
and types. Using the same ELF definition header for all compilation
targets allows removing some #ifdefs depending on the host OS since we
know all required ELF constants will always be present. To reduce the
size of this commit, the CMake_USE_ELF_PARSER definite will be removed
in a separate commit.

This allows me to use CMAKE_BUILD_WITH_INSTALL_RPATH=False and the Ninja
generator on macOS, whereas before it would always give me the following
error message (despite cross-compiling for an ELF-based platform):

```
The install of the <name> target requires changing an RPATH from
  the build tree, but this is not supported with the Ninja generator unless
  on an ELF-based platform.  The CMAKE_BUILD_WITH_INSTALL_RPATH variable may
  be set to avoid this relinking step.
```
2021-06-24 10:57:51 -04:00
Alex Richardson
0da1540aaa cmELF: Fix check for TagMipsRldMapRel
DT_MIPS_RLD_MAP_REL is a machine-speicific dynamic tag, so other
architectures could re-use the value of 0x70000035 to mean something
else.  Before using DT_MIPS_RLD_MAP_REL, we have to check that the ELF
file is actually has a e_machine of EM_MIPS.
2021-06-24 10:57:51 -04:00
Brad King
e21188df8b cmELF: Open file explicitly in binary mode
ELF is a binary format.
2021-06-24 10:57:51 -04:00
Brad King
6c5f21d10e Merge topic 'clang-compiler-warnings'
88e56c2e5a Enable compiler warnings when compiling CMake with Clang
cadf2b632e Fix -Wpessimizing-move warnings in QCMake::loadPresets()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6252
2021-06-23 08:56:28 -04:00
Kitware Robot
fd2aa87278 CMake Nightly Date Stamp 2021-06-23 00:01:09 -04:00
Alex Richardson
cadf2b632e Fix -Wpessimizing-move warnings in QCMake::loadPresets() 2021-06-22 16:13:21 +01:00
Brad King
66488d4eb3 Merge topic 'cmsystemtools-multiple-formats'
2e1149874d cmSystemTools: Support multiple binary formats

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6239
2021-06-22 09:44:06 -04:00
Kitware Robot
ea02397dab CMake Nightly Date Stamp 2021-06-22 00:01:10 -04:00
Brad King
d60d6c269a Merge topic 'ctest_runtime_labels'
bd38749fd4 ctest: allow test output to add labels

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6234
2021-06-21 09:52:36 -04:00
Brad King
cbdd6747ad Merge topic 'msvc-isystem'
f29e1874ad Compiler/MSVC: use the `-external:I` flag for system includes
5a5c85dffd Tests/IncludeDirectories: support MSVC in system include tests
399a3204bb Tests/IncludeDirectories: align sibling predicates
20ab49193b Tests/IncludeDirectories: factor out applying flags to targets
809f7b0c3a Tests/IncludeDirectories: fix copy pasta for otherlib
b094324948 Tests/IncludeDirectories: Include system headers via angle brackets
8f63f3b04e cmVisualStudio10TargetGenerator: remove unused variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Julien Waechter <greenjava@gmail.com>
Acked-by: DE-VS wenglor <devs.wenglor@gmail.com>
Merge-request: !4766
2021-06-21 09:50:52 -04:00
Alex Richardson
2e1149874d cmSystemTools: Support multiple binary formats
This prepares the code to handle both the ELF and XCOFF being enabled by
trying to parse an ELF file first and if that fails falling back to XCOFF.
2021-06-21 09:36:39 -04:00
Kitware Robot
858164d155 CMake Nightly Date Stamp 2021-06-21 00:01:20 -04:00
Kitware Robot
93a63425b6 CMake Nightly Date Stamp 2021-06-20 00:02:10 -04:00
Kitware Robot
4e518a852a CMake Nightly Date Stamp 2021-06-19 00:01:13 -04:00
Ben Boeckel
f29e1874ad Compiler/MSVC: use the -external:I flag for system includes
See: #17904
2021-06-18 09:54:17 -04:00
Brad King
c35273c22d Merge topic 'vs-utf-8'
9ba99a1203 VS: Add support for Utf8Enconding when using VS 16.10+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6238
2021-06-18 09:39:24 -04:00
Brad King
57322b572d Merge topic 'vs-flag-tables'
b0f830ced6 VS: Do not apply any '/external:*' flag table mapping on VS < 16.10
3fd65f5ca6 VS: Compare VS instance versions as strings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6241
2021-06-18 09:38:27 -04:00
Kitware Robot
5ef8c09a8f CMake Nightly Date Stamp 2021-06-18 00:01:12 -04:00
Zack Galbreath
bd38749fd4 ctest: allow test output to add labels
Parse test output for <CTestLabel>...</CTestLabel>.
If found, add this value to the list of labels associated with this test.
2021-06-17 14:09:01 -04:00
Ben Boeckel
8f63f3b04e cmVisualStudio10TargetGenerator: remove unused variable 2021-06-17 14:02:52 -04:00
Gustavo Varo
9ba99a1203 VS: Add support for Utf8Enconding when using VS 16.10+
On VS 16.10 Preview 2 or above, generate `UseUtf8Encoding`
instead of `StdOutEncoding=UTF-8` in `.vcxproj` files.

Fixes: #22032
2021-06-17 13:44:22 -04:00
Brad King
11695f5985 Begin post-3.21 development 2021-06-17 13:18:30 -04:00
Brad King
22fb0713a2 Begin 3.21 release versioning 2021-06-17 13:17:06 -04:00
Brad King
b0f830ced6 VS: Do not apply any '/external:*' flag table mapping on VS < 16.10
Since commit 887e9df0c7 (VS: Update v142 CL flag table for VS 16.10,
2021-06-04) we map several `/external:*` flags to their corresponding
`.vcxproj` elements.  These elements were added to `cl.xml` in VS 16.10,
so filter them out in older VS versions.  Add a field to the json flag
table format to specify the minimum version of VS needed for a given
mapping.

Issue: #22308
2021-06-17 08:25:04 -04:00
Brad King
3fd65f5ca6 VS: Compare VS instance versions as strings
This makes the values more readable.
2021-06-17 07:54:48 -04:00
Brad King
1aa16906e6 Merge topic 'fix-flow-control-override'
c017098d4d CMake: Allow override of unexpected non-flow-control commands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6232
2021-06-17 06:47:42 -04:00
Brad King
e05cf2d2de Merge topic 'vs-map-external-warnings'
ab3830401f Merge branch 'backport-3.20-vs-map-external-warnings'
e4ca525d84 VS: Do not apply '/external:W*' flag table mapping on VS < 16.10
aabc3ca47d cmGlobalVisualStudio10Generator: Adopt GetVSInstanceVersion method
e66a7fe07b cmGlobalVisualStudio10Generator: Move static functions to anonymous namespace
947f0c8b81 VS: Do not apply '/external:W*' flag table mapping on VS < 16.10
e59a208b69 cmGlobalVisualStudio10Generator: Adopt GetVSInstanceVersion method
d6d4af0ec3 cmGlobalVisualStudio10Generator: Move static functions to anonymous namespace

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6233
2021-06-17 06:45:57 -04:00
Kitware Robot
e80f56a7e5 CMake Nightly Date Stamp 2021-06-17 00:03:04 -04:00
Brad King
e4ca525d84 VS: Do not apply '/external:W*' flag table mapping on VS < 16.10
Since commit 9054cd05e6 (VS: Add flag table entries for '/external:W*'
flags in VS 16.10, 2021-05-28, v3.20.4~10^2) we map flags to the
`ExternalWarningLevel` element.  VS 16.9 does not support that element,
but its `cl` compiler does support the `/external:W*` flags.  Filter out
the flag table entry on older VS versions.

Fixes: #22308
2021-06-16 13:24:32 -04:00
Brad King
aabc3ca47d cmGlobalVisualStudio10Generator: Adopt GetVSInstanceVersion method
Port from `cmGlobalVisualStudioVersionedGenerator`.
2021-06-16 13:22:32 -04:00
Brad King
e66a7fe07b cmGlobalVisualStudio10Generator: Move static functions to anonymous namespace 2021-06-16 13:20:44 -04:00
Kyle Edwards
c017098d4d CMake: Allow override of unexpected non-flow-control commands
Fixes: #22310
2021-06-16 10:39:39 -04:00
Brad King
a9fbc4959a Merge topic 'scandep-format'
a35d121276 Ninja: Populate P1689R4 compiled-module-path field for Fortran
10b2e53469 cmScanDepFormat: Remove Fortran-specific compiled-module-path logic
2b9890e9b9 cmScanDepFormat: Avoid writing lookup-method with default value

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6228
2021-06-16 08:19:28 -04:00
Kitware Robot
24399a8d84 CMake Nightly Date Stamp 2021-06-16 00:01:09 -04:00
Brad King
a35d121276 Ninja: Populate P1689R4 compiled-module-path field for Fortran
When scanning Fortran dependencies, we know the file path at which a
provided module file is written.  Store it in the `compiled-module-path`
field as specified by P1689R4.  Our collator in `cmake_ninja_dyndep` no
longer needs to assume that the module file path can be derived from the
logical module name.  In the future, the Fortran dependency scanning may
be done by the compiler itself, in which case it will provide the value
of `compiled-module-path`.
2021-06-15 09:11:06 -04:00
Brad King
10b2e53469 cmScanDepFormat: Remove Fortran-specific compiled-module-path logic
Read and write the `compiled-module-path` field only when explicitly
known.  Move the assumption that the `compiled-module-path` can be
derived from the logical module name from the scandep parser to the
`cmake_ninja_dyndep` helper.
2021-06-15 09:09:28 -04:00
Brad King
2b9890e9b9 cmScanDepFormat: Avoid writing lookup-method with default value 2021-06-15 08:48:05 -04:00
Brad King
998fa490f4 Merge topic 'ninja-scandep-preprocessor-output'
312ced6547 cmNinjaTargetGenerator: Fix scan rule PREPROCESSED_SOURCE placeholder
1dd9c4ab6f cmNinjaTargetGenerator: Clarify GetScanBuildStatement condition
d94b23885a cmNinjaTargetGenerator: Simplify scan rule response file selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6227
2021-06-15 08:40:29 -04:00
Kitware Robot
b302dd776c CMake Nightly Date Stamp 2021-06-15 00:01:25 -04:00
Brad King
312ced6547 cmNinjaTargetGenerator: Fix scan rule PREPROCESSED_SOURCE placeholder
When running the module dependencies scan tool for for a language that
does not compile the preprocessed output, we do not actually put the
preprocessed output in the build graph.  However, the value of
`CMAKE_EXPERIMENTAL_<LANG>_SCANDEP_SOURCE` may reference the placeholder
for the preprocessed source.  Populate the placeholder to keep the file
out of the way.  In particular, do not clobber the `.ddi` file.
2021-06-14 15:15:39 -04:00
Brad King
1dd9c4ab6f cmNinjaTargetGenerator: Clarify GetScanBuildStatement condition
Use the `compilePP` variable directly rather than relying on callers
to make `compilePP == !ppFileName.empty()`.
2021-06-14 15:11:20 -04:00
Brad King
d94b23885a cmNinjaTargetGenerator: Simplify scan rule response file selection
Since commit 33a8e0bb09 (cmNinjaTargetGenerator: Simplify scan rule
depfile selection, 2020-11-06, v3.20.0-rc1~516^2~1), the `$out` of the
scan rule always matches our `.rsp` file selection, so use `$out.rsp`.
2021-06-14 15:06:34 -04:00
Brad King
b61fe6a831 CMake 3.20.4 2021-06-14 11:05:49 -04:00
Brad King
6b218d2e26 Merge topic 'objc-std-17-23'
e8dc95ae1e ObjectiveC: Add C17 and C23 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6219
2021-06-14 09:49:22 -04:00
Brad King
6fa9f3c695 Merge topic 'fileapi-link-fragments'
68bbec66e0 fileapi: Fix codemodel-v2 link command fragment relative paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6220
2021-06-14 09:41:50 -04:00
Kitware Robot
6230be4975 CMake Nightly Date Stamp 2021-06-14 00:01:14 -04:00
Kitware Robot
d0ddef5812 CMake Nightly Date Stamp 2021-06-13 00:01:06 -04:00
Kitware Robot
8a4f3fd861 CMake Nightly Date Stamp 2021-06-12 00:01:11 -04:00
Brad King
68bbec66e0 fileapi: Fix codemodel-v2 link command fragment relative paths
Use the same `cmLinkLineComputer` subclass as the generator does.  This
affects the base directory from which relative paths are computed.

Fixes: #22301
2021-06-11 11:11:36 -04:00