Commit Graph

53926 Commits

Author SHA1 Message Date
Brad King d647ca1849 Merge branch 'help-try-compile-result-var' into release-3.21
Merge-request: !6923
2022-01-31 11:36:46 -05:00
friendlyanon 34d263270e Help: Drop incorrect versionadded for try_compile result variable
In commit c705279bae (Help: Add `.. versionadded` directives to commands
documentation, 2020-11-08, v3.20.0-rc1~508^2) we accidentally added
``versionadded`` markup suggesting that the first argument to
`try_compile` was fixed as `RESULT_VAR` prior to CMake 3.14.  This was
probably due to misinterpreting the change from commit 7975edeac5 (Help:
User-provided variable names for try_* commands, 2019-02-24,
v3.14.0-rc3~16^2~3).

The result variable has never been fixed.  Drop the incorrect markup.
2022-01-31 10:59:56 -05:00
Brad King 9025bde5c3 Merge branch 'message-flush' into release-3.21
Merge-request: !6913
2022-01-27 16:25:41 -05:00
Brad King 634587e322 message: Restore explicit flushing of messages on stderr
In the `cmake` command-line tool, the `message()` command with no
message mode argument prints the message stderr using the C++ `cerr`
stream.  Since commit 0a0a0f8a74 (cmMessenger: Color messages to
terminal by type, 2021-05-18, v3.21.0-rc1~146^2) and an update by
commit c7a8c9c811 (cmMessenger: Revert to non-color messages on
Windows, 2021-07-20, v3.21.1~15^2), we print the newline at the end of
the message using just `\n`.  We've now observed some cases of output
on stdout and stderr getting jumbled when the two go to the same file
descriptor.  Previously the newline was printed with `endl`, which
implicitly flushes.  Flush explicitly to restore that behavior.

Fixes: #23155
2022-01-27 16:06:35 -05:00
Brad King fc153c7ef8 Merge branch 'FindThreads-libc-pthread-flag' into release-3.21
Merge-request: !6906
2022-01-26 08:54:00 -05:00
Mattias Ellert 5efb6fb516 FindThreads: Honor THREADS_PREFER_PTHREAD_FLAG when pthread is found in libc
The `-pthread` flag tells the compiler/linker to link to additional
libraries needed for thread support (e.g. libatomic on riscv64). The
flag therefore should be used if requested using
`THREADS_PREFER_PTHREAD_FLAG` also when the pthread functions are
found in libc.
2022-01-26 08:50:16 -05:00
Brad King ece5378536 Merge branch 'nmake-rsp-encoding' into release-3.21
Merge-request: !6905
2022-01-26 08:45:11 -05:00
Brad King d5ee6d50ee NMake: Use UTF-8 BOM in response files only with MSVC tooling
Since commit f3f57cc4ed (NMake: Use UTF-8 with BOM if supported by
nmake, 2021-04-22, v3.21.0-rc1~217^2), we add a BOM to response files
to tell MSVC tooling that they are encoded as UTF-8.  However, the
"NMake Makefiles" generator may also be used with non-MSVC toolchains
that do not understand the BOM.  Update the response file encoding
selection heuristic to add the BOM only with MSVC tooling.

Fixes: #23143
2022-01-26 07:57:43 -05:00
Brad King cab631c2e2 NMake: Document response file encoding heuristic in a comment
Since commit f3f57cc4ed (NMake: Use UTF-8 with BOM if supported by
nmake, 2021-04-22, v3.21.0-rc1~217^2) the encoding of response files is
selected based on the makefile encoding.  In principle these may be
orthogonal, but in practice it is a useful heuristic.  Call out this
heuristic in a comment, and leave a FIXME to do something better.
2022-01-26 07:40:36 -05:00
Brad King 74f14997c6 Merge branch 'ci-xcode-13.2' into release-3.21
Merge-request: !6897
2022-01-25 05:43:40 -05:00
Brad King 8cb32fc8ad gitlab-ci: update macOS jobs to use Xcode 13.2 2022-01-25 05:06:40 -05:00
Brad King 88198e65f6 Merge branch 'vs2022-v143-link-guard-cf' into release-3.21
Merge-request: !6858
2022-01-12 16:53:51 -05:00
Benjamin Sluis 9e24437c91 VS: Remove the '/guard:cf' flag from v143 link flag table
Apply the change from commit db35e3cfd6 (VS: Fix support for '/guard:cf'
linker flag for v142, 2019-01-24, v3.14.0-rc1~74^2~2) to the v143 flag
table.

The entry for `LinkControlFlowGuard` in `v143_Link.json` does not work
when used in a `.vcxproj` file.  Drop our link flag table entries for
this toolset so that the flag will be passed via `AdditionalOptions`.

Also add a test case.
2022-01-12 16:45:07 -05:00
Brad King b8e0b40734 Merge branch 'vs-intel-oneapi-toolset' into release-3.21
Merge-request: !6806
2021-12-15 15:58:43 -05:00
William R. Dieter 612c0d49f4 VS: Fix detecting icx.exe with Intel Compiler toolsets newer than 2021
The logic added by commit 7808cbd644 (CMakeDetermineCompilerId: support
Intel DPC++ compiler toolset for VS gen, 2020-12-06, v3.20.0-rc1~330^2)
matches a specific toolset known to be the `icx.exe` compiler, and
assumes all other Intel C++ compilers (that are not DPC++) must be
`icl.exe`.

Since `icx.exe` is officially replacing `icl.exe`, use a regex that
matches the now-fixed set of toolsets known to use `icl.exe`.  Any other
Intel C++ compiler will be assumed to be `icx.exe`.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-12-15 15:56:20 -05:00
Brad King b54d61c4a0 Merge branch 'ci-xcode-13.1' into release-3.21
Merge-request: !6757
2021-11-22 19:40:47 -05:00
Brad King 224d81e804 gitlab-ci: update macOS jobs to use Xcode 13.1 2021-11-22 18:04:43 -05:00
Brad King bad7959397 Merge branch 'UseSWIG-create-workingdir' into release-3.21
Merge-request: !6750
2021-11-19 12:12:07 -05:00
Marc Chevrier 7224eb5185 UseSWIG: ensure directory for depfile exists
When `Visual Studio` and `Xcode` generators are used, directory for depfile
is not implicitely created by CMake when OUTFILE_DIR option is used.

Fixes: #22932
2021-11-19 17:50:52 +01:00
Brad King c468f983c0 Merge branch 'release-3.20' into release-3.21 2021-11-18 09:00:15 -05:00
Brad King 80b6b201a6 Merge branch 'IntelLLVM-Fortran-copy-mod' into release-3.21
Merge-request: !6740
2021-11-17 10:42:51 -05:00
Brad King 7cc7f9aa26 Merge branch 'IntelLLVM-Fortran-copy-mod' into release-3.20
Merge-request: !6740
2021-11-17 10:42:37 -05:00
Brad King 209b896f2c IntelLLVM: Enable Fortran module rebuild avoidance in Makefile generators
The Makefile generators use an internal `cmake -E cmake_copy_f90_mod`
tool to avoid rebuilding module consumers when the `.mod` content
changes only in a trivial way (e.g. the time it was built).  This is
done with logic specific to each vendor's module file format.  Enable
the "Intel" format support when using the IntelLLVM compiler (ifx) too.

Issue: #22922
2021-11-17 10:41:30 -05:00
Brad King bb48c75817 Merge branch 'release-3.20' into release-3.21 2021-11-12 08:59:43 -05:00
Brad King 521c49eebc Merge branch 'IntelLLVM-Fortran-frontend-variant' into release-3.21
Merge-request: !6718
2021-11-11 11:24:01 -05:00
Brad King 09ef62fd98 Merge branch 'IntelLLVM-Fortran-frontend-variant' into release-3.20
Merge-request: !6718
2021-11-11 11:23:35 -05:00
William R. Dieter b1edd6e7c7 Fortran: Save frontend variant persistently for IntelLLVM
Since commit a90d2a9eed (IntelLLVM: Add support for Intel LLVM-based
compilers, 2020-11-02, v3.20.0-rc1~89^2~20), our IntelLLVM compiler
support populates `CMAKE_Fortran_COMPILER_FRONTEND_VARIANT`.  However,
the frontend variant was not stored in `CMakeCompilerFortran.cmake`.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-11-11 11:22:07 -05:00
Brad King b0ee34373a Merge branch 'IntelLLVM-no-xilink' into release-3.21
Merge-request: !6719
2021-11-10 13:43:41 -05:00
William R. Dieter 48f29b5805 IntelLLVM: Use MSVC linker with MSVC frontend variant
The Intel compiler (pre-LLVM) expected xilink.exe and had special logic to
set xilink.exe.  The newer LLVM-based compiler does not want xilink.exe.
link.exe works better for host code, and is the default, so change
the matching condition such that the old compiler matches (and gets
xilink.exe) and the new compiler gets the default link.exe it expects.

A better solution will be to use the compiler as the linker.  A future
change will switch to compiler as linker by default, but that fix needs
more validation.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-11-10 13:41:06 -05:00
Brad King d18ba5b226 Merge branch 'doc-TARGET_RUNTIME_DLLS' into release-3.21
Merge-request: !6700
2021-11-03 16:18:29 -04:00
Brad King 001870d451 Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets
This generator expression does not report the locations of `.dll`
files on imported targets with the `UNKNWON` type, since their
`IMPORTED_LOCATION` refers to the import library and not the DLL.

Fixes: #22845
2021-11-03 16:17:17 -04:00
Brad King 6202af6092 Merge branch 'msvc-cxx-modules-scanDependencies' into release-3.21
Merge-request: !6696
2021-11-03 10:51:37 -04:00
Brad King 9ed1d7bee6 cmScanDepFormat: Accept P1689r4 files with version 1
VS 2022's `cl` 19.30 has a `-scanDependencies` option that produces the
P1689r4 format.  It reports the "version" field with value "1".
2021-11-03 10:50:54 -04:00
Brad King ac5932c9e4 Merge branch 'GNUtoMS-vs2022' into release-3.21
Merge-request: !6695
2021-11-03 10:34:05 -04:00
Brad King 571a795d2f GNUtoMS: Add search path for VS 2022 environment scripts
Extend the logic from commit 08c5b3eff0 (GNUtoMS: Add search path for VS
2019 environment scripts, 2020-01-09, v3.16.3~15^2) to consider VS 2022
paths too.

Fixes: #22847
2021-11-03 10:32:14 -04:00
Brad King f65cebf51a CMake 3.21.4 v3.21.4 2021-10-27 09:51:39 -04:00
Brad King 9d44ea4cde Merge branch 'backport-3.21-vs2022' into release-3.21
Merge-request: !6664
2021-10-27 09:00:58 -04:00
Brad King f3ddc52676 VS: Update Visual Studio 17 2022 generator for the Release Candidates
Assume this is close enough to the final release to treat as
non-experimental support.
2021-10-27 08:49:47 -04:00
Brad King 69355ff00c Merge branch 'binutils-llvm-strip' into release-3.21
Merge-request: !6655
2021-10-22 09:25:24 -04:00
Brad King 5dd981539f BinUtils: Avoid llvm-strip versions older than Clang 11
Since commit cf82300a63 (BinUtils: Clarify search logic and make it more
consistent, 2021-05-27, v3.21.0-rc1~119^2~2) we correctly prefer the
more-specific name `llvm-strip` over `strip` when using Clang.  However,
`llvm-strip` from Clang versions prior to 11 require extra flags to
strip everything.  Until our `install(TARGETS)` logic learns to add
those flags, avoid using older versions of `llvm-strip` by default.

Fixes: #22785
2021-10-22 09:24:46 -04:00
Brad King 69c6994023 Merge branch 'backport-3.21-vs2022' into release-3.21
Merge-request: !6640
2021-10-19 09:35:50 -04:00
Brad King 3d9d75b0be VS: Update Visual Studio 17 2022 generator for the Release Candidate 2021-10-19 09:27:37 -04:00
Brad King 71dc6feed8 Merge branch 'release-3.20' into release-3.21 2021-10-15 12:15:15 -04:00
Brad King e8e64e1a0c Merge branch 'release-3.19' into release-3.20 2021-10-15 12:15:05 -04:00
Brad King 8497701d22 Merge branch 'fix-ifdef-windows' into release-3.21
Merge-request: !6631
2021-10-15 12:14:50 -04:00
Brad King ad76bedabb Merge branch 'fix-ifdef-windows' into release-3.20
Merge-request: !6631
2021-10-15 12:14:38 -04:00
Brad King f00763c954 Merge branch 'fix-ifdef-windows' into release-3.19
Merge-request: !6631
2021-10-15 12:13:59 -04:00
Brad King 40e73c5ac4 Source: Fix typo in _WIN32 preprocessor checks
Since CMake's default compiler flags with MSVC include `-DWIN32` for
historical reasons, a few preprocessor conditions were accidentally
checking for `WIN32` instead of `_WIN32`.  The corresponding blocks
were left out when compiling official binaries for `cmake.org` because
we hard-code compiler flags without `-DWIN32`.

Fixes: #22764
2021-10-15 11:39:04 -04:00
Brad King 4d4336e3ed Merge branch 'backport-3.21-vs2022' into release-3.21
Merge-request: !6628
2021-10-14 13:50:11 -04:00
Brad King a8414190da VS: Update Visual Studio 17 2022 generator for Preview 5 2021-10-14 13:39:45 -04:00