Commit Graph

11743 Commits

Author SHA1 Message Date
Brad King 06d103889c Merge topic 'clang-ipo-support'
3dd776ccfd Windows-Clang: Support duplicate object names in LTO archives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6082
2021-05-05 10:07:26 -04:00
Brad King 4ff6c5e34c Merge topic 'binutils-var-private'
c33fb2e664 BinUtils: Use more-private temporary variable names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6085
2021-05-05 10:06:03 -04:00
Brad King c33fb2e664 BinUtils: Use more-private temporary variable names
Since commit 4d786dfcfa (BinUtils: Avoid clobbering a variable named
without a private prefix, 2021-04-06, v3.20.1~4^2) we use variables
named `_tool` and `_name`, but these may still be common enough to
affect project code.  Use `_CMAKE_TOOL` and `_CMAKE_TOOL_NAME` instead,
and unset them when finished.

Fixes: #22140
2021-05-04 12:44:14 -04:00
Michael Hirsch 7398993f5b Help: Document CMAKE_TLS_VERIFY variable explicitly
Previously it was mentioned only in the `file` and `ExternalProject`
documentation.
2021-05-04 12:29:13 -04:00
Brad King abc78a3557 Merge topic 'mingw-archive-no-replace'
e8f0b75ff9 Windows-GNU: Support duplicate object names when linking shared libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6081
2021-05-04 11:30:38 -04:00
Brad King b78d312de6 Merge topic 'findswig-clean'
229dd42158 Change find_path scope and add quotes
ff6f7b232f FindSWIG: reduce calls to SWIG exe, and clean up variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6075
2021-05-04 11:28:33 -04:00
Brad King a0594739d1 Merge topic 'useswig-includes'
d2296cdaab UseSWIG: remove duplicate target includes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6074
2021-05-04 11:26:51 -04:00
Brad King 79427dccc2 Merge topic 'FindBLAS-mkl-omp'
20ab504591 FindBLAS: Do not statically link against iomp5 in the case of Intel MKL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6001
2021-05-04 11:23:11 -04:00
Brad King 7e31edee22 Merge topic 'compile-features-lang-vars'
bd16a985fc CompilerId/Features: Tolerate variables named for languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Timothy Brackett <brackett.tc@gmail.com>
Merge-request: !6060
2021-05-04 11:20:39 -04:00
Brad King 3dd776ccfd Windows-Clang: Support duplicate object names in LTO archives
Update the archive rules added by commit 6e3655db2c (Clang: add LTO
support for GNU-command line clang on windows, 2019-07-08,
v3.16.0-rc1~161^2~3) to match the `ar` convention we use for normal
archives.

Issue: #21988
2021-05-03 14:37:20 -04:00
Brad King e8f0b75ff9 Windows-GNU: Support duplicate object names when linking shared libraries
Extend the change from commit 39d0ade07e (Windows-GNU: Support duplicate
object names in large archives (#14874), 2014-04-14, v3.1.0-rc1~629^2~1)
to apply to the temporary archive we create for linking shared libraries
with MinGW tools.

Issue: #21988
2021-05-03 14:29:26 -04:00
Seth R Johnson 229dd42158 Change find_path scope and add quotes 2021-05-03 13:30:32 -04:00
Brad King bd16a985fc CompilerId/Features: Tolerate variables named for languages
If a `CMakeLists.txt` or `CMAKE_TOOLCHAIN_FILE` sets a variable named
`C`, `CXX`, or `CUDA`, we were previously comparing each enabled
language name to the value of that variable, rather than the name
itself.  Double-quote the string to take advantage of policy `CMP0054`,
but also add "x" prefixes to support projects that do not set the
policy.

Fixes: #22125
2021-05-03 10:22:23 -04:00
Seth R Johnson ff6f7b232f FindSWIG: reduce calls to SWIG exe, and clean up variables
If all SWIG cache variables (EXECUTABLE, DIR, VERSION) are set,
there should be no need to invoke the SWIG exe on a reconfigure. This
changeset reduces the number of calls to the SWIG executable, and
additonially prevents temporary `SWIG_xxx` values from propagating outside
the `find_package` call.

I also refactored the conditionals to be less nested (and thus more
predictable), including changing theh definition of SWIG_USE_FILE to
reflect that it's if and only if SWIG_FOUND is trure.
2021-05-02 10:05:44 -04:00
Seth R Johnson d2296cdaab UseSWIG: remove duplicate target includes 2021-05-02 09:17:57 -04:00
Eisuke Kawashima 20ab504591 FindBLAS: Do not statically link against iomp5 in the case of Intel MKL
fix #21811
2021-04-30 08:38:41 +09:00
Brad King d94f8516ab Merge topic 'find-msys'
990b370401 FindMsys: Add a module to find MSYS and some bundled packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6057
2021-04-29 09:22:27 -04:00
Brad King 3147f541f7 Merge topic 'intel-2021'
9c479c7c40 IntelLLVM: Add special case for ifx 2021.1 version extraction
b7193ab18f Intel: Update Classic compiler version detection for 2021

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6052
2021-04-29 09:15:32 -04:00
Orgad Shaneh 990b370401 FindMsys: Add a module to find MSYS and some bundled packages 2021-04-28 10:41:17 -04:00
Brad King 9c479c7c40 IntelLLVM: Add special case for ifx 2021.1 version extraction
The ifx beta versions forgot to define `__INTEL_LLVM_COMPILER`, and
instead define `__INTEL_COMPILER == 201900`.  Add a special case.

Issue: #22120
2021-04-28 10:21:27 -04:00
Brad King b7193ab18f Intel: Update Classic compiler version detection for 2021
The value of the `__INTEL_COMPILER` macro changed convention starting
in version 2021.

Fixes: #22120
2021-04-28 10:20:59 -04:00
Brad King c58ec3209b Merge topic 'cpack-nsis-uninstall-name'
79f48da5c2 CPack/NSIS: Fix CPACK_NSIS_UNINSTALL_NAME when not Uninstall.exe

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6050
2021-04-28 09:51:00 -04:00
Brad King 11530e5504 Merge topic 'ARMClang-cpu-arch-flags'
c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
0078db3888 ARMClang: Separate cpu/arch flags from preceding flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jaeden Amero <kitware@patater.com>
Merge-request: !6035
2021-04-28 09:49:41 -04:00
Markus Israelsson 79f48da5c2 CPack/NSIS: Fix CPACK_NSIS_UNINSTALL_NAME when not Uninstall.exe
If a previous installation was detected by the NSIS script the
uninstaller was not correctly run unless it was still named
`Uninstall.exe`.  This meant that using `CPACK_NSIS_UNINSTALL_NAME`
was simply broken.

Fixes: #22103
2021-04-27 14:06:42 -04:00
Lingkai Dong c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
The compile options `--march=<arch>` and `--mcpu=<cpu>` and the
link option `--cpu=<cpu>` are automatically added by CMake based
on `CMAKE_SYSTEM_PROCESSOR` or `CMAKE_SYSTEM_ARCH`. But this is not
sufficient, because armclang also supports enabling or disabling
features using `+<feature>`:

    -mcpu=<name>[+[no]<feature>+...]

For example:

    -mcpu=cortex-a57+nocrypto+nofp+nosimd+crc

(Reference: https://developer.arm.com/documentation/dui0774/k/Compiler-Command-line-Options/-mcpu?lang=en)

The problem is, even if a project adds a flag with features it needs,
CMake still adds flags, resulting in code that is compiled with wrong
CPU features and unable to run.

Add policy `CMP0123` to not automatically add compile or link options,
and let projects set them instead.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21173
2021-04-27 14:03:15 -04:00
Brad King 0078db3888 ARMClang: Separate cpu/arch flags from preceding flags
Suggested-by: Kim Kryger
2021-04-27 13:58:57 -04:00
Brad King 95afd87917 Merge topic 'FindIconv-no-libc'
404025b00c FindIconv: Avoid explicitly finding C runtime library
8b30e7adfb FindIntl: Use explicit find_library signature NAMES keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
Merge-request: !6046
2021-04-27 13:54:51 -04:00
Brad King 404025b00c FindIconv: Avoid explicitly finding C runtime library
If `iconv` functionality is built into the C runtime library,
we do not need to link any libraries.  Do not find `libc`.

Fixes: #22114
2021-04-26 14:30:29 -04:00
Orgad Shaneh ddcd1469e8 MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
2021-04-26 14:27:34 -04:00
Brad King c9aec3d4a9 FindCurses: Do not assume ncurses is installed on CYGWIN 2021-04-26 14:27:34 -04:00
Brad King 8b30e7adfb FindIntl: Use explicit find_library signature NAMES keyword 2021-04-26 13:00:35 -04:00
Brad King 9d4a0f12fb Merge topic 'SWIG'
e3e005dbd8 UseSWIG: use swig dependencies for Xcode generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6042
2021-04-26 11:35:22 -04:00
Brad King 3c1655936f Merge topic 'lzma-threads'
c5c130e675 cmArchiveWrite: Consolidate multiple ways to set thread count
5380d858ff liblzma: Enable multi threaded stream encoding support
e9065e96dc Merge branch 'upstream-liblzma' into lzma-threads
ee909a8e8b liblzma 2020-03-17 (2327a461)
741b85b42b liblzma: Revise update script to get version 5.2.5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6014
2021-04-26 11:33:49 -04:00
Brad King 8bc64a0c40 Merge topic 'doc-compile-features-wcdh'
1f4ec3f4a7 Help: Do not recommend WCDH in cmake-compile-features(7)
1cc63f2cd5 Help: Fix typos in cmake-compile-features(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6037
2021-04-26 11:27:17 -04:00
Marc Chevrier e3e005dbd8 UseSWIG: use swig dependencies for Xcode generator 2021-04-23 17:09:12 +02:00
Brad King 1f4ec3f4a7 Help: Do not recommend WCDH in cmake-compile-features(7)
Since commit da7ad7997e (WriteCompilerDetectionHeader: Add policy to
remove module, 2020-12-04, v3.20.0-rc1~350^2), the WCDH module is
deprecated.  Update the `cmake-compile-features(7)` manual section that
previously recommended WCDH to make such detection the project's
responsibility instead.  Move the old content of the section over to the
WCDH module to preserve it.
2021-04-23 10:44:53 -04:00
Brad King 7de707cd7e Merge topic 'cuda-host-compiler-windows'
625ef88a92 CUDA: Add CMAKE_CUDA_HOST_COMPILER support on Windows non-VS generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6030
2021-04-23 10:30:15 -04:00
Nils Gladitz c5c130e675 cmArchiveWrite: Consolidate multiple ways to set thread count
Merge use of SetFilterOption() into more abstract thread count
in cmArchiveWrite constructor.

libarchive defaulting of threads for threads == 0 seems to be
configuration dependent. Preemptively default thread count via
std::thread::hardware_concurrency().

Also allow negative values for the thread count in which case
the detected hardware concurrency is also used but the given
absolute thread count is used as an upper limit.
2021-04-22 15:40:13 -04:00
Nils Gladitz 5380d858ff liblzma: Enable multi threaded stream encoding support 2021-04-22 15:40:06 -04:00
Brad King 298760661f ExternalData: Improve error message when we fail to create a file
Report the underlying system error.
2021-04-22 13:06:11 -04:00
unknown 625ef88a92 CUDA: Add CMAKE_CUDA_HOST_COMPILER support on Windows non-VS generators 2021-04-22 11:40:46 -04:00
Brad King cb6889a09c FindLAPACK: Fix finding generic LAPACK with BLA_STATIC
Fixes: #21071
2021-04-21 14:41:46 -04:00
Brad King 193714d67d Find{BLAS,LAPACK}: Simplify search for static libraries
Now that `CHECK_{BLAS,LAPACK}_LIBRARIES` are functions, we can set
`CMAKE_FIND_LIBRARY_SUFFIXES` locally without affecting the global
state.  This avoids the need for local state switching that was added in
commit 9ef82d95d8 (FindBLAS: Fix detection of OpenMP as dependency of
BLA_STATIC, 2021-04-07, v3.20.1~3^2), so remove that.
2021-04-21 14:23:17 -04:00
Brad King 2e2db28e2f Find{BLAS,LAPACK}: Simplify check_function_exists state maintenance
Now that `CHECK_{BLAS,LAPACK}_LIBRARIES` are functions, we can set
`CMAKE_REQUIRED_QUIET` locally without affecting the global state.
2021-04-21 14:20:28 -04:00
Brad King f6ea1b59e1 Merge topic 'cxxprefix'
4c741d945a BinUtils: Restore toolchain prefix detection from compiler name 'c++'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Thomas Bernard <thomas@famillebernardgouriou.fr>
Merge-request: !6011
2021-04-19 09:44:51 -04:00
Brad King 16f213efa3 Merge topic 'fujitsu-fixup'
cc0d2004b2 Fujitsu: Fix C90 standard flags
ec78e86cc8 FujitsuClang: Use GNU-like command-line

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5997
2021-04-16 11:38:40 -04:00
Lihua Zhao 4c741d945a BinUtils: Restore toolchain prefix detection from compiler name 'c++'
Since commit b12aec6c8d (BinUtils: prefer bin utils matching the
compiler version extension, 2020-12-11, v3.20.0-rc1~171^2) we recognize
`clangg++` and `g++` but not `c++`.  Restore `[gc]` in place of `g`
in the regex, as we had before that change.

Fixes: #22069
2021-04-16 09:20:16 -04:00
Paul Zehner cc0d2004b2 Fujitsu: Fix C90 standard flags
Fix typos from commit 3c867cff4a (Fujitsu: Add support for the Fujitsu
compiler in Trad mode, 2020-12-22).
2021-04-14 15:19:59 -04:00
Paul Zehner ec78e86cc8 FujitsuClang: Use GNU-like command-line 2021-04-14 15:18:24 -04:00
Brad King dcd604ee62 Find{BLAS,LAPACK}: Make library variable names more robust 2021-04-14 14:57:03 -04:00