Commit Graph

56090 Commits

Author SHA1 Message Date
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
Raul Tambre daf372c4d6 CUDA: Fix issuing error if default architecture detection fails
We require CUDA_ARCHITECTURES to be set for targets (see CMP0104). If not set
anything after compiler detection such as ABI detection will fail to generate.
This means we need to error if CMAKE_CUDA_ARCHITECTURES is not set to a valid
value as a result of compiler detection.

Currently we fail to issue the error if compiler detection failed and the ID is
unset. In such a case we won't define detected_architecture making the code
responsible for the error unreachable.

Simplify the detection of architectures used during compiler detection by
always detecting all of them, which enables us to simply the check in the
"default to compiler" path if CMAKE_CUDA_ARCHITECTURES is empty.
As a result we need to move the error checking and CMAKE_CUDA_ARCHITECTURES=OFF
handling fully into the default path thus simplifying the code and unifying the
code paths for NVCC and CUDA.
This also happens to fix:
1. CMAKE_CUDA_ARCHITECTURES=OFF on Clang.
2. A theoretical issue of a compiler defaulting to multiple architectures.

I've additionally added printing of the compiler output along the error to
better reveal possible underlying compiler/system configuration issues.

Fixes #23010.
2022-01-27 22:11:13 +02:00
Raul Tambre 7a0d098352 CUDA: Error on empty/invalid CMAKE_CUDA_ARCHITECTURES set by user
If empty we otherwise treat it the same as unset in most places, but still end
up failing eventually with a confusing "Failed to find a working CUDA
architecture".

This also detects some other basic invalid ones (e.g. "al").
2022-01-27 22:11:13 +02:00
Raul Tambre d19273bc7b CUDA: Support all and all-major on Visual Studio
The Visual Studio integration's CodeGeneration option only knows how to
generate a -gencode flag, which doesn't recognize all. Add a special case to
pass these two as regular additional flags.
2022-01-27 21:43:52 +02:00
Raul Tambre 5f667d783a CUDA: Actually use reverse architecture deprecation order for Clang
The code now matches what the comment describes.
This mistake seems to have been present since the initial introduction in
commit 5df21adf (CUDA: Add support for Clang compiler, 2020-05-07).
2022-01-27 21:43:22 +02:00
Brad King d282ca55b8 Merge topic 'findcuda_quotes'
f590ea506a FindCUDA: Make version extraction robust to empty output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6908
2022-01-27 11:14:08 -05:00
Brad King 93daefc905 Merge topic 'doc_fixes'
1f4c1d1735 Help: Add missing word in CMAKE_CURRENT_{BINARY,SOURCE}_DIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6907
2022-01-27 11:12:45 -05:00
Brad King f4893ac0b1 Merge topic 'enlarge-build-file-stream-buffer'
bbdb000c55 GlobalNinjaGenerator: enlarge file stream buffer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6903
2022-01-27 11:11:59 -05:00
Brad King b41b841cc6 Merge topic 'encode-literal-inplace'
5c3f188bef GlobalNinjaGenerator: Add EncodeLiteralInplace which doesn't copy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6904
2022-01-27 11:11:11 -05:00
Brad King 6a9a0d98e2 Merge topic 'vs-version-enum-class'
a88f98b3be Make cmGlobalVisualStudioGenerator::VSVersion enum class

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6902
2022-01-27 11:10:21 -05:00
Brad King 1acf9aec75 Merge topic 'lcc-lexer-warnings'
a8fbe9a2fa LexerParser: Suppress LCC warnings in generated code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6896
2022-01-27 11:08:26 -05:00
Brad King 6f2e478b86 Merge branch 'release-3.22' 2022-01-27 11:07:11 -05:00
Brad King 206a2cc43e Merge branch 'release-3.21' into release-3.22 2022-01-27 11:07:06 -05:00
Brad King dc5db3cacc Merge branch 'release-3.21' 2022-01-27 11:06:53 -05:00
Brad King 0ef94991e9 Merge branch 'release-3.22' 2022-01-27 11:05:04 -05:00
Brad King 67d604a792 Merge topic 'nmake-rsp-encoding'
d5ee6d50ee NMake: Use UTF-8 BOM in response files only with MSVC tooling
cab631c2e2 NMake: Document response file encoding heuristic in a comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6905
2022-01-27 11:05:04 -05:00
Brad King 5588b538d8 Merge topic 'nmake-rsp-encoding' into release-3.22
d5ee6d50ee NMake: Use UTF-8 BOM in response files only with MSVC tooling
cab631c2e2 NMake: Document response file encoding heuristic in a comment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6905
2022-01-27 11:05:03 -05:00
Brad King 57595c6673 Merge branch 'release-3.22' 2022-01-27 11:04:08 -05:00
Brad King e1c575eeaa Merge topic 'FindThreads-libc-pthread-flag'
5efb6fb516 FindThreads: Honor THREADS_PREFER_PTHREAD_FLAG when pthread is found in libc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6906
2022-01-27 11:04:08 -05:00
Brad King 6a037fd9f4 Merge topic 'FindThreads-libc-pthread-flag' into release-3.22
5efb6fb516 FindThreads: Honor THREADS_PREFER_PTHREAD_FLAG when pthread is found in libc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6906
2022-01-27 11:04:06 -05:00
Brad King 98c40dd22e bootstrap: Avoid TOC overflow on AIX powerpc
Since commit 5c58a7e4d2 (ppc64: Work around TOC overflow with platform
specific linker flags, 2019-02-27, v3.15.0-rc1~460^2) we use a bigtoc
flag on this platform when building CMake with CMake.  Add it to the
bootstrap script too.
2022-01-27 09:58:10 -05:00
Brad King 493d6a66bb bootstrap: Remove stray indentation 2022-01-27 09:57:33 -05:00
Brad King 8c1731546c Help: Add release note for IBM Open XL C/C++ compiler support 2022-01-27 09:38:01 -05:00
Aaron Liu 24da80b70a Utilities: Suppress warnings in third-party code with IBMClang 2022-01-27 09:38:01 -05:00
Aaron Liu 6da99e671c IBMClang: Add support for IBM Open XL C/C++
Fixes: #22929
2022-01-27 09:38:01 -05:00
Kitware Robot 44939f01e7 CMake Nightly Date Stamp 2022-01-27 00:01:14 -05:00
David Berard f590ea506a FindCUDA: Make version extraction robust to empty output
I found that `NVCC_OUT` was sometimes empty when I was building.
2022-01-26 14:07:17 -05:00
Clemens Wasser bbdb000c55 GlobalNinjaGenerator: enlarge file stream buffer 2022-01-26 17:09:21 +01:00
Kai Köhne 1f4c1d1735 Help: Add missing word in CMAKE_CURRENT_{BINARY,SOURCE}_DIR 2022-01-26 11:03:14 -05:00
Brad King a8fbe9a2fa LexerParser: Suppress LCC warnings in generated code 2022-01-26 08:58:03 -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 dbfa449f08 Merge topic 'parser-cleanup'
4959276c02 cmListFileCache: Remove cmCommandContext
0386641142 cmListFileCache: Rename FromCommandContext to FromListFileFunction
3c4fa4c892 cmListFileCache: Move cmListFileFunction earlier

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6899
2022-01-26 08:05:01 -05:00
Brad King 8732639b79 Merge branch 'release-3.22' 2022-01-26 08:04:15 -05:00
Brad King 6d778ea6db Merge topic 'FindMPI-static-first'
036d0cbbde FindMPI: Place static first in mpi test source

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6900
2022-01-26 08:04:15 -05:00
Brad King 94189fc397 Merge topic 'FindMPI-static-first' into release-3.22
036d0cbbde FindMPI: Place static first in mpi test source

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6900
2022-01-26 08:04:14 -05:00
Brad King e2035fb0f9 Merge topic 'FindXercesC-NAMES_PER_DIR'
47cbc08594 FindXercesC: Use NAMES_PER_DIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6898
2022-01-26 08:03:16 -05:00
Brad King a600b9207e Merge topic 'cache-short-paths'
6f835c3699 cmOutputConverter: Cache Short Paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6887
2022-01-26 08:02:23 -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
Kitware Robot c4acdcbc1c CMake Nightly Date Stamp 2022-01-26 00:01:16 -05:00
Clemens Wasser 5c3f188bef GlobalNinjaGenerator: Add EncodeLiteralInplace which doesn't copy 2022-01-25 21:39:49 +01:00
Sumit Bhardwaj a88f98b3be Make cmGlobalVisualStudioGenerator::VSVersion enum class 2022-01-25 11:25:18 -08:00
Brad King 036d0cbbde FindMPI: Place static first in mpi test source
Move the `static` added by commit 8cce0ad32f (FindMPI: Fix missing
static warning in the mpi test source, 2021-06-30, v3.22.0-rc1~502^2) to
the beginning of the line.

Fixes: #23141
2022-01-25 09:53:24 -05:00
Brad King 5f9ba8c686 Merge branch 'release-3.22' 2022-01-25 09:40:52 -05:00
Brad King 8428e39ed9 CMake 3.22.2 v3.22.2 2022-01-25 08:45:06 -05:00
Brad King 4959276c02 cmListFileCache: Remove cmCommandContext
Subsume it inside `cmListFileFunction`.
2022-01-25 08:40:41 -05:00
Brad King 0386641142 cmListFileCache: Rename FromCommandContext to FromListFileFunction
Accept a `cmListFileFunction` instead of a `cmCommandContext`.
2022-01-25 08:39:52 -05:00