1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-11 00:23:40 +08:00

83 Commits

Author SHA1 Message Date
Brad King
115425e68c Configure CMake itself with policies through CMake 3.29 2024-06-05 13:24:36 -04:00
Brad King
e449ae8492 Merge topic 'cxx-checks-icpx-overriding'
557a5f3083 cm_cxx_features: Filter out icpx -Woverriding-t-option warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9577
2024-06-04 08:56:34 -04:00
Brad King
557a5f3083 cm_cxx_features: Filter out icpx -Woverriding-t-option warnings
Issue: #20664
2024-06-03 11:46:24 -04:00
Martin Mokry
c9e30d75d2
cm_cxx_features: Ignore distcc warnings
Filter out warnings of distcc which does not provide information
about compiler feature availability.

Fixes: #22573
2024-06-02 12:26:13 +02:00
jinzhe li
6a2cfbd4ea cm_cxx_features: Ignore Clang unused-argument warnings
Filter out `-Wunused-command-line-argument` warnings from Clang (that
can be caused by user-specified flags) so that they do not break our
checks for C++ feature availability.

This extends commit 71b65abca2 (C++ feature checks: Filter out warnings
caused by user flags, 2017-09-19, v3.10.0-rc1~90^2).
2024-04-15 12:09:49 -04:00
Brad King
ba6f3f25ee Configure CMake itself with policies through CMake 3.28 2024-02-06 17:07:16 -05:00
Michael Hirsch
ad4481fa00
Source: Enhance check for C++17 filesystem support
* Add `lexically_normal` test for all platforms.

* On Windows, MinGW does not currently handle `lexically_normal()`
  correctly on UNC path, but MSVC and IntelLLVM do--add a comment
  on this to avoid future confusion.

* Add test with `\\?\` notation and `weakly_canonical` that also triggers
  the MinGW bug, but is fine with MSVC and oneAPI, for a more robust and
  comprehensive test.
2023-12-05 11:30:08 -05:00
Brad King
0e7ef08e10 Merge topic 'RH-gcc-toolset-10-bug-check'
40af103402 cmCMakePath: do not use std::filesystem::path with RH gcc-toolset-10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9026
2023-12-05 09:29:45 -05:00
Marc Chevrier
40af103402 cmCMakePath: do not use std::filesystem::path with RH gcc-toolset-10
Fixes: #25458, #25453
2023-12-04 17:39:06 +01:00
Sean McBride
47c3334203 Source: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
Brad King
be045c7c16 Configure CMake itself with policies through CMake 3.27 2023-10-03 17:21:47 -04:00
Brad King
02765cc9c4 Merge topic 'cxx-atomic'
fa3c4b6dbf Source: Link libatomic when needed on any Linux architecture

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8756
2023-08-25 09:41:27 -04:00
Brad King
fa3c4b6dbf Source: Link libatomic when needed on any Linux architecture
Extend commit 78bbd58545 (Source: Link libatomic when needed on Linux
32-bit ARM, 2023-07-27, v3.27.2~10^2) to check for libatomic on more
architectures.

Fixes: #25204
2023-08-24 13:05:45 -04:00
Brad King
8268fc8661 Merge topic 'cxx-atomic'
78bbd58545 Source: Link libatomic when needed on Linux 32-bit ARM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8663
2023-07-28 09:08:40 -04:00
Brad King
78bbd58545 Source: Link libatomic when needed on Linux 32-bit ARM
Fixes: #25114
2023-07-27 11:07:21 -04:00
Brad King
1b11f48741 Configure CMake itself with policies through CMake 3.26 2023-06-07 14:32:04 -04:00
Roffild
442170a5e7 cm_cxx_features: Ignore MSVC command-line warnings (Dxxxx)
The Dxxxx warning range is for command-line warnings [1].  These are
incidental and should not affect the result of the feature check.

[1] https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/command-line-errors-d8000-through-d9999
2023-03-02 10:25:16 -05:00
Brad King
d70582eed8 ccmake: Update minimum required version of CMake for curses check
This should have been part of commit d6b811fb82 (Require CMake 3.13+ to
configure CMake itself, 2022-02-22, v3.24.0-rc1~605^2~1).
2023-03-01 09:15:38 -05:00
Brad King
7c71f9b1e8 Merge topic 'filesystem-path-c++03-abi'
ee9805ccd1 cm/filesystem: Fix crash with pre-C++11 std::string GNU ABI in C++17

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7813
2022-10-21 10:06:22 -04:00
Brad King
ee9805ccd1 cm/filesystem: Fix crash with pre-C++11 std::string GNU ABI in C++17
The `remove_filename` and `replace_extension` methods compute an offset
between the whole path in a `std::string` and a part of a path in a
`std::string_view`.  This is done by subtracting their `.data()`
pointers.  However, C++17 adds a non-const `.data()` through which
modification of the string is allowed.  This means the copy-on-write
implementation used by the pre-C++11 std::string GNU ABI must reallocate
if the string has been copied.  Our subtraction then computes an offset
between two different allocations, which is undefined behavior.

The workaround in commit b3ca4f9ad1 (cm/filesystem: Work around crash
when compiled for CYGWIN/MSYS runtime, 2021-04-22, v3.21.0-rc1~271^2~2)
avoided the problem by calling the non-const `.data()` to reallocate
before constructing the `string_view`.  Instead, explicitly call the
const `.data()` method on the string, which does not reallocate.

Fixes: #22090, #23328
2022-10-20 18:31:50 -04:00
Gregor Jasny
116cc5a57b cm_cxx_features: filter out warnings from Xcode 14
```
xcodebuild[13070:54426] [MT] DVTSDK: Warning: SDK path collision for path
```
2022-06-21 10:48:37 -04:00
Marc Chevrier
10689e564f cm_cxx_filesystem.cxx: revert erroneous change
Revert erroneous change introduced by commit 0a81ea1.
2022-03-15 15:38:09 +01:00
Marc Chevrier
0a81ea1f12 Genex-LINK_GROUP: Add possibility to group libraries at link step
Fixes: #23121
2022-02-28 10:26:26 +01:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03: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
Marc Chevrier
6cee4c6a8b Restore support for cross-compiling CMake itself
In commit eb583b0a66 (cmake_path command: path management, 2020-07-23,
v3.19.0-rc1~216^2~1) we added a `try_run`.  In cross-compilation mode,
C++ features tests must avoid running tests if there is no emulator
defined.
2021-01-18 12:23:23 -05:00
Anonymous Maarten
b756ec8a46 cm_cxx_features: Filter out MSBXXXX warnings
When building CMake in `%TMP%` on Windows, MSBuild issues warnings.
Filter those out to avoid breaking C++ feature checks.

Fixes: #21270
2020-10-08 09:24:02 -04:00
Marc Chevrier
eb583b0a66 cmake_path command: path management
Fixes: #19568, #20922
2020-09-06 10:52:25 +02:00
Marc Chevrier
d654bf3449 STL Support: Add cm::filesystem::path in <cm/filesystem> 2020-07-09 17:02:42 +02:00
Brad King
e776ff0582 Merge topic 'cm_cxx_features-icpc-10121'
231637eae2 cm_cxx_features: Filter out 'icpc: command line warning #10121'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4698
2020-05-01 08:24:21 -04:00
Jennifer Kathleen Green
231637eae2 cm_cxx_features: Filter out 'icpc: command line warning #10121'
This warning appears for:

    overriding '-xCORE-AVX2' with '-march=haswell'`

in some Cray environments.

Fixes: #20664
2020-04-30 13:27:59 -04:00
Brad King
5aa1ef1df8 Merge topic 'cm_cxx_features-libhugetlbfs'
4ab0d37b41 cm_cxx_features: Filter out libhugetlbfs warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4681
2020-04-30 09:52:12 -04:00
Jennifer Green
4ab0d37b41 cm_cxx_features: Filter out libhugetlbfs warnings
Without this, CMake fails to build on Cray systems with a
craype-hugepages modulefile loaded on the front-end due to libhugetlbfs
warnings breaking the CXX Feature tests.  Filter out the warnings so the
bootstrap can proceed to successfully install CMake on Cray Linux
systems.

Fixes: #20645
2020-04-29 08:08:59 -04:00
Raul Tambre
e758331595 cm_cxx_features: Remove CUDA installation warning filtering
This has been fixed in upstream LLVM. No released version contains this issue.
d32170dbd5
eb2ba2ea95
2020-04-01 10:34:35 +03:00
Raul Tambre
6ebc6cec41 cm_cxx_features: Filter out CUDA installation warnings
Clang always outputs these if it doesn't recognize the installed CUDA version.
They don't affect compiling C++.

Fixes #20434.
2020-03-09 09:17:41 -04:00
Brad King
e9e0e401c6 Merge topic 'cmext-memory'
fc3b4caa2e Memory management: cast functions for managed pointers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4064
2019-12-04 14:22:01 -05:00
Marc Chevrier
fc3b4caa2e Memory management: cast functions for managed pointers 2019-11-27 16:03:04 +01:00
Marcus Calhoun-Lopez
ee28580c33 C++ feature checks: Ignore linker warnings 2019-11-25 13:14:57 -07:00
Alex Turbov
7b2dd9dedc
Refactor: Use added message types in various modules
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2019-11-02 14:10:09 +02:00
Brad King
170fcd715f Extend C++17 feature checks to require std::optional 2019-08-23 08:43:35 -04:00
Brad King
b7a861647e Merge topic 'cxx-checks-warning-match'
4ca5a815f2 C++ feature checks: Match warnings more strictly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3075
2019-03-08 07:31:36 -05:00
Brad King
4ca5a815f2 C++ feature checks: Match warnings more strictly
Require the word "warning" to appear at the start of a line, after
whitespace, or after a `:`.  This is the same that CTest launchers use
to match warnings.  It avoids matching "warning" inside file paths.

Fixes: #19019
2019-03-07 14:55:54 -05:00
Mathieu Garaud
a605bf438e Extend C++17/C++14 feature checks to cover more standard library APIs
Make sure `std::cbegin`, `std::cend`, and `std::size` work in C++17 or
C++14 mode before choosing the corresponding standard level for
compiling CMake itself.  This helps in cases that the compiler is using
a standard library too old to support the full standard level chosen.
2019-02-27 11:27:17 -05:00
Mathieu Garaud
e17deb7ad4 Extend C++17/C++14 feature checks to cover more standard library APIs
Make sure `std::cbegin`, `std::cend`, and `std::size` work in C++17 or
C++14 mode before choosing the corresponding standard level for
compiling CMake itself.  This helps in cases that the compiler is using
a standard library too old to support the full standard level chosen.
2019-02-27 11:24:43 -05:00
Zsolt Parragi
d625dfcdf9 Avoid compiling CMake itself as C++17 with Clang's MSVC ABI
GUID functions in ATL cause compilation errors with this compiler.
Add the offending case to our check for C++17 support so that it
is not used by default when it does not work.
2019-02-11 15:04:19 +01:00
Brad King
2ca89b5a69 C++ feature checks: Filter out libstdc++ sprintf warnings
On OpenBSD linking to `libstdc++` with GCC 6.4 always warns:

    warning: sprintf() is often misused, please use snprintf()

These do not affect the availability of C++ features we're checking,
so filter them out.

Fixes: #18602
2018-11-20 12:50:45 -05:00
Brad King
3a2c736b41 Extend C++17/C++14 feature checks to require unique_ptr
When testing compiler modes higher than C++11 for constructs we need,
include a check for using `unique_ptr` in that mode.  The PGI 18.4
compiler in some environments supports `unique_ptr` in C++11 mode
but is broken for C++14 and C++17.  Check that `unique_ptr` works
in these modes before using one.
2018-08-01 14:03:43 -04:00
Gregor Jasny
057ecb8f6f C++ feature checks: Ignore Xcode warnings 2018-06-19 10:56:50 -04:00
luz.paz
be28106880 Fix misc. typos
Found via `codespell` and `grep`
2018-06-04 10:32:49 -04:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -04:00