1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 05:26:58 +08:00

48 Commits

Author SHA1 Message Date
Michael Pratt
d3baf456c2 cm_cxx_features: Ignore ninja warnings
Future changes to ninja may make harmless warnings more likely.
Filter them out from compiler feature checks.
2024-08-14 17:27:32 -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
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
78bbd58545 Source: Link libatomic when needed on Linux 32-bit ARM
Fixes: #25114
2023-07-27 11:07:21 -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
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
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
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
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
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
Gregor Jasny
057ecb8f6f C++ feature checks: Ignore Xcode warnings 2018-06-19 10:56:50 -04:00
Brad King
2254b72061 C++ feature checks: Filter out warnings caused by local configuration
In some environments the linker produces warnings like

    warning: directory not found for option
    warning: object file compiled with -mlong-branch ...

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

Fixes: #17850, #17947
2018-04-30 09:18:15 -04:00
Brad King
b2f612a0fa Simplify CM_FALLTHROUGH implementation
Use the macro now provided by KWSys instead of using `try_compile`
checks.  It will no longer consider the `__attribute__((fallthrough))`
variant, but compilers that don't have one of the modern attributes
shouldn't warn about not using one anyway.
2017-11-30 09:50:39 -05:00
Brad King
b8018135b5 Use C++11 '= delete' instead of CM_EQ_DELETE
We now require C++11 support including `= delete`.  Drop use of
the old compatibility macro.
2017-09-28 09:50:18 -04:00
Brad King
9e0362caa1 Remove checks for auto_ptr that we no longer need
We no longer use `auto_ptr` at all, so drop the checks for it.
2017-09-27 09:04:31 -04:00
Brad King
71b65abca2 C++ feature checks: Filter out warnings caused by user flags
Filter out `-Winvalid-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.
2017-09-19 09:25:30 -04:00
Brad King
eb3abf8b2b C++ feature checks: Prepare for multiple check output filters 2017-09-19 09:22:54 -04:00
Brad King
4e14498f4f Drop now-unused definition of CM_OVERRIDE 2017-09-15 10:06:41 -04:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Daniel Pfeifer
cbcfb79f9c Use C++11 unordered containers 2017-08-22 23:05:27 +02:00
Brad King
f44d9bcc8f C++ feature checks: Improve exclusion of "0 Warning(s)"
Simply matching "0 Warning" may match "10 Warning(s)".  Instead remove
the entire `    0 Warning(s)` content from the MSBuild output before
searching it for warnings.

Issue: #16942
2017-06-08 09:22:09 -04:00
Walter Gray
f4ce396254 C++ feature checks: Do not match "0 Warning(s)" as a warning
The change in commit v3.9.0-rc1~6^2~1 (C++ feature checks: check output
for '[Ww]arning', 2017-06-03) accidentally matches `0 Warning(s)` in the
output and always thinks a warning exists, thus failing all checks in
Visual Studio builds.

Fixes: #16942
2017-06-06 08:55:43 -04:00
Daniel Pfeifer
8d7b3ef5d4 Provide and use CM_FALLTHROUGH 2017-06-03 08:38:51 +02:00
Daniel Pfeifer
0068224fdd C++ feature checks: check output for '[Ww]arning' 2017-06-03 08:38:51 +02:00
Brad King
f74f01fe69 Check C++ features even without CMAKE_CXX_STANDARD for CMake itself
When using `CMake_NO_CXX_STANDARD` a user may still provide `-std=c++11`
or similar flags in `CMAKE_CXX_FLAGS`, so we should still check for the
available C++ features.
2017-05-19 09:22:38 -04:00
Daniel Pfeifer
5d1671324b cmConfigure: provide macros CM_EQ_DELETE and CM_DISABLE_COPY 2017-04-22 10:09:41 +02:00
Daniel Pfeifer
67480c05e3 Add a feature check to test availability of auto_ptr 2016-09-26 09:03:46 -04:00
Brad King
aa50cdac43 Check for availability of unique_ptr and make_unique when building CMake
Some code paths may find these useful if available.
2016-09-16 13:22:10 -04:00
Daniel Pfeifer
b4b73f56a2 cxx features: add check for nullptr 2016-06-27 23:24:39 +02:00
Daniel Pfeifer
5286110d6f cxx features: add check for override 2016-06-27 10:37:41 -04:00
Daniel Pfeifer
09aa2c9418 Use <unordered_set> where available 2016-06-27 10:37:40 -04:00
Daniel Pfeifer
ea5477e43d Make C++ feature checks extensible
Turn the feature check for cxx11_unordered_map into a function such that
we can use it for other features as well.  Drop the 11 suffix, as we may
want to check features from other standards.
2016-06-27 10:37:40 -04:00