Commit Graph

30382 Commits

Author SHA1 Message Date
Marc Chevrier
6a6efdcaed Makefiles: Normalize compiler-generated depfile paths
Even though Makefile generators pass source files and include
directories by absolute path to the compiler, the compiler may generate
depfile paths relative to the current working directory.  For example,
`ccache` with `CCACHE_BASEDIR` may transform paths this way.  When
reading a depfile, convert relative dependencies to absolute paths
before placing them in `compiler_depend.make`, which is later evaluated
in the top-level build directory.

Fixes: #22364
2021-07-02 09:24:57 -04:00
Brad King
efa5e1f367 CMake 3.20.5 2021-06-21 11:23:19 -04:00
Brad King
acd82e4690 Merge topic 'fix-flow-control-override' into release-3.20
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
947f0c8b81 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 11:08:15 -04:00
Brad King
e59a208b69 cmGlobalVisualStudio10Generator: Adopt GetVSInstanceVersion method
Port from `cmGlobalVisualStudioVersionedGenerator`.
2021-06-16 10:57:15 -04:00
Brad King
d6d4af0ec3 cmGlobalVisualStudio10Generator: Move static functions to anonymous namespace 2021-06-16 10:57:14 -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
b61fe6a831 CMake 3.20.4 2021-06-14 11:05:49 -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
Brad King
e3c420a74f Merge topic 'presets-build-fixes' into release-3.20
534c40e6d8 presets: Fix buildPreset "targets" not allowing a single string
5d67632813 presets: Fix buildPreset "jobs"
93e396b402 presets: Fix buildPreset "jobs" field test case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !6190
2021-06-09 07:57:34 -04:00
Sam Freed
534c40e6d8 presets: Fix buildPreset "targets" not allowing a single string
Fixes: #22272
2021-06-08 07:47:54 -04:00
Sam Freed
5d67632813 presets: Fix buildPreset "jobs"
Fixes: #22273
2021-06-08 07:47:24 -04:00
Brad King
316cbbe8d5 Makefiles: Fix CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule
Extend the fix from commit 67e2130c96 (Makefiles: Fix
CMAKE_EXPORT_COMPILE_COMMANDS crash with custom compile rule,
2020-11-20, v3.19.1~8^2) to work for the `<FLAGS>` placeholder too.
Also fix the test case to actually enable `EXPORT_COMPILE_COMMANDS`
on the test target.

Fixes: #22261
2021-05-28 15:41:38 -04:00
Brad King
a60141feaa VS: Add special case for '-T version=14.29.16.10' under VS 16.10
Extend the table of special cases from commit 58a50a3a0a (VS: Fix '-T
version=14.28' under VS 16.9, 2021-03-11, v3.19.7~1^2~1).  Add a special
case for the name VS 16.11 will use for VS 16.10's default toolset, so
that it can be used with VS 16.10 too.

Using '-T version=14.29.16.10' actually works under VS 16.10 without
this change, but only because there is only one 14.29 toolset so the
two-component prefix happens to match the right one.  Make it explicit.

Issue: #21922
2021-05-27 17:06:27 -04:00
Brad King
13d112ea03 CMake 3.20.3 2021-05-27 14:05:04 -04:00
Kyle Edwards
38f2562d5b CMP0082: Check EXCLUDE_FROM_ALL property at generate time
Fixes: #22234
2021-05-24 13:56:59 -04:00
Brad King
0348b22a0c Merge topic 'cmake_build_and_install_command_error_when_given_bad_arguments' into release-3.20
f78b167a23 cmCommandLineArgument: Provide more information syntax error messages
5aa0dec6b0 cmake: `--build` and `--install` error out when encountering bad flags
928cdb17c5 cmCommandLineArgument: Correctly record parsing failures

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6119
2021-05-14 08:33:28 -04:00
Robert Maynard
f78b167a23 cmCommandLineArgument: Provide more information syntax error messages 2021-05-13 09:33:30 -04:00
Robert Maynard
5aa0dec6b0 cmake: --build and --install error out when encountering bad flags
Fixes #22186
2021-05-13 09:28:42 -04:00
Brad King
3a71534402 Ninja: Restore support for Fortran in a symlinked build tree
Since commit f3eed2c49d (cmGlobalNinjaGenerator: use P1689 dependency
file format for Fortran, 2019-03-12, v3.20.0-rc1~454^2), Fortran stopped
working in a build tree whose path contains a symlink.  The reason is
that the P1689r3 format's `work-directory` field gets populated with the
realpath (via `getcwd`) of the build tree instead of the logical path to
the build tree used for generating relative paths in `build.ninja`.
This causes the `Fortran.dd` file to get absolute (real)paths to `.o`
files, and Ninja does not match them with the relative `.o` file paths
in `build.ninja`.

Fix this by dropping use of the `work-directory` field.  This restores
our prior approach of generating paths in the dyndep file using the same
forms of paths received from the buildsystem generator.  The P1689r3
paper's format may need to be revised to account for this.

Fixes: #21683
2021-05-12 10:15:43 -04:00
Robert Maynard
928cdb17c5 cmCommandLineArgument: Correctly record parsing failures 2021-05-12 09:43:33 -04:00
Brad King
5972094708 ObjectiveC: Respect OSX_ARCHITECTURES for OBJC
Fix a typo from commit 940fc62962 (macOS: Respect OSX_ARCHITECTURES for
ASM, 2020-08-21, v3.19.0-rc1~270^2).

Fixes: #22152
2021-05-05 10:45:01 -04:00
Kyle Edwards
ad08f93ee4 Ninja Multi-Config: Split long command lines by config
Fixes: #22123
2021-04-30 14:46:21 -04:00
Brad King
1ad4501ae9 CMake 3.20.2 2021-04-29 09:53:54 -04:00
Kyle Edwards
f8e2a74712 Ninja Multi-Config: Correctly generate POST_BUILD custom targets
Fixes: #22096
2021-04-22 15:51:53 -04:00
Brad King
b84f1e6159 Autogen: Restore mocs_compilation in OBJECT libraries
Since commit f65f20938c (Autogen: Avoid processing CSharp targets,
2020-11-12, v3.20.0-rc1~301^2) we collect all sources for a target
earlier than previously.  Clear the sources cache so that it will be
re-computed later after AUTOGEN processing.

Fixes: #22085
2021-04-20 16:04:08 -04:00
Brad King
a2372f64b4 Merge topic 'mrjoel/add-missing-not' into release-3.20
370bebd921 Add missing 'not' in error messages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6012
2021-04-19 09:44:02 -04:00
Joel Johnson
370bebd921 Add missing 'not' in error messages 2021-04-16 07:47:59 -06:00
Kyle Edwards
53d523f2e1 autogen: fix race in depfile parsing
cmReadGccDepfile() calls cmSystemTools::CollapseFullPath(), which
is not thread safe due to internal caching. Serialize calls to
cmReadGccDepfile() in autogen to avoid thread safety issues.

Fixes: #22014
2021-04-15 15:25:38 -04:00
Rafael Sadowski
317a477283 OpenBSD: Fix system feature definitions
Since commit f034b0f663 (CMake compilation: do not use compiler
extensions, 2020-03-14, v3.18.0-rc1~494^2), some sources explicitly
enable needed system APIs on some platforms using definitions like
`_POSIX_C_SOURCE` and `_XOPEN_SOURCE`.  Drop the definitions for
OpenBSD, which provides the POSIX APIs by default.
2021-04-14 11:02:29 -04:00
Brad King
9765ccfa71 CMake 3.20.1 2021-04-08 08:00:50 -04:00
Brad King
049757b8a8 Merge topic 'genex-HOST_LINK-in-try_compile' into release-3.20
6cf81efe7d Genex: $<HOST_LINK:> and $<DEVICE_LINK:> must be usable in try_compile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5964
2021-04-01 10:22:15 -04:00
Brad King
fca5aa8b33 Merge topic 'CUDA-device-link' into release-3.20
bb96984ec9 CUDA Device link: Ensure all link options are correctly formatted

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5962
2021-04-01 10:21:11 -04:00
Brad King
369d5c2bcf Merge topic 'make-fix-deps-paths' into release-3.20
1b346350af Makefiles dependencies: normalize windows paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5955
2021-04-01 10:19:58 -04:00
Marc Chevrier
6cf81efe7d Genex: $<HOST_LINK:> and $<DEVICE_LINK:> must be usable in try_compile
Fixes: #22007
2021-03-31 19:03:35 +02:00
Marc Chevrier
bb96984ec9 CUDA Device link: Ensure all link options are correctly formatted
Fixes: #21994
2021-03-31 12:05:23 +02:00
Brad King
c0092247fe Merge topic 'ninja-automoc-cycle' into release-3.20
ca7c76269b Tests: Add test for Ninja automoc dependency cyle
54ad3e4958 autogen: Don't include SKIP_AUTOMOC files in depfile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jörg Bornemann <joerg.bornemann@qt.io>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !5956
2021-03-30 09:54:09 -04:00
Brad King
1df75b171d Merge topic 'nmc-cc-no-output' into release-3.20
6dd89529e8 Ninja Multi-Config: Fix crash on custom command config with no output
e21a80e97d Tests: Teach RunCMake to ignore incidental 'Recompacting log' ninja output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5950
2021-03-30 09:50:48 -04:00
Marc Chevrier
1b346350af Makefiles dependencies: normalize windows paths
Fixes: #21997
2021-03-30 15:04:03 +02:00
Kyle Edwards
54ad3e4958 autogen: Don't include SKIP_AUTOMOC files in depfile
SKIP_AUTOMOC files should not be included in moc processing, which
means they shouldn't be included in the depfile either. Remove them.

Fixes: #21977
2021-03-29 15:17:11 -04:00
Brad King
6dd89529e8 Ninja Multi-Config: Fix crash on custom command config with no output
With generator expressions in a custom command's `OUTPUT` and
`BYPRODUCTS`, it is possible to have no outputs at all for a particular
configuration.  Generate no rule in this case.

Fixes: #21989
2021-03-29 09:56:43 -04:00
Brad King
d212d91f14 Merge topic 'commands-file-permissions' into release-3.20
769ff05483 Help: Clarify permission-related command options
900184616a Cleanup: Fix misspelt name of local C++ variable
635431a0c9 Tests: Check host platform instead of target for running stat
4ceb0ca59e Tests: Remove redundant files for configure_file() tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5945
2021-03-29 09:32:09 -04:00
Brad King
0e37e0d215 Merge topic 'correct_arg_parsing' into release-3.20
79d7bcaf40 cmCommandLineArgument: correctly compute next parse index

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5936
2021-03-29 09:29:39 -04:00
Robert Maynard
79d7bcaf40 cmCommandLineArgument: correctly compute next parse index
Fixes #21966

Correctly compute the next parse index for `ZeroOrOne` when
it is zero, and for OneOrMore.
2021-03-26 09:34:46 -04:00
Craig Scott
900184616a Cleanup: Fix misspelt name of local C++ variable 2021-03-26 22:17:57 +11:00
Kyle Edwards
3b864b2583 Ninja Multi-Config: Include configs in long CC scripts
Fixes: #21973
2021-03-25 13:18:47 -04:00
Craig Scott
a6a5256395 CPack: Validate and document NSIS branding text trim positions 2021-03-24 16:35:29 +11:00
Brad King
b7b0fb4303 CMake 3.20.0 2021-03-23 11:43:17 -04:00
Brad King
06feb845aa CMP0118: Fix NEW behavior when looking up target sources
Under the CMP0118 NEW behavior, sources generated in one directory
should be visible when added to targets in other directories.  This was
accidentally left out of commit 6624b65b3f (GENERATED prop: Add
implementation for policy CMP0118 being set to NEW, 2020-11-09,
v3.20.0-rc1~393^2~1).

Fixes: #18399
2021-03-18 09:57:49 -04:00
Brad King
fab7fe7ef5 CMake 3.20.0-rc5 2021-03-17 10:16:33 -04:00