30 Commits

Author SHA1 Message Date
w00657280 c8bc56b0c6 fix:update cmake to 3.28.2
Signed-off-by: w00657280 <wuyuechang3@huawei.com>
2024-06-06 10:57:34 +08:00
Brad King c2baafd867 cm::optional: Fix -Wunused-parameter warnings in comparison operators 2021-01-25 14:44:09 -05:00
Kyle Edwards 447c42e280 cm::optional: Add constructor delegation to nullopt_t constructor
Some static analysis tools incorrectly identify this constructor
as leaving _has_value in an undefined state. Explicitly call the
default constructor to force _has_value to false.
2020-10-22 11:40:48 -04:00
Kyle Edwards 6a23f55ff2 cm::optional: Fix move assignment 2020-10-21 14:23:43 -04:00
Marc Chevrier b270694cb7 cmake_path: enhancements
* Fix error on parsing "c:a" (root-name without root-directory)
* Enrich documentation
2020-09-20 15:17:34 +02:00
Kyle Edwards 44d902e109 Merge topic 'cm-optional-comparison'
10cf676376 cm::optional: Add comparison operators
1276736b78 Refactor: Add ASSERT_TRUE() macro to testOptional.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5195
2020-09-08 09:55:18 -04:00
Kyle Edwards 10cf676376 cm::optional: Add comparison operators 2020-09-07 08:50:09 -04:00
Marc Chevrier 55e183976d cmCMakePath: Class for path handling 2020-09-06 10:34:17 +02:00
Kitware Robot aa80ae5e88 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (2047543b enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Fred Baksik 73964ac7b5 STL Support: Fix cm::filesystem warnings; check for '\' not multichar ' \'.
Utilities/std/cm/bits/fs_path.cxx:334:24: warning: multi-character character constant [-Wmultichar]
             || *ptr == ' \\'
                        ^~~~~
2020-07-24 19:36:46 -04:00
Marc Chevrier 00b2af5d1d STL Support: cm::filesystem::path: add support of Cygwin 2020-07-20 16:20:42 +02:00
Marc Chevrier 66fcf5734c STL Support: Add cm::filesystem::path in <cm/filesystem> 2020-07-09 17:02:42 +02:00
Marc Chevrier 01b578b6f1 STL Support: introduce dedicated configuration file 2020-07-09 15:24:43 +02:00
Marc Chevrier 29416b3028 STL Support: Add function cm::quoted in <cm/iomanip> 2020-07-09 15:24:43 +02:00
Sumit Bhardwaj eb118db5f5 Implement cm::static_reference_cast by declval
Previously, cm::static_reference_cast used invoke_result_t and took the
address of O::get. This is not in complete conformance with standard.

This MR changes the implementation to use std::declval<O>.get() which is
always well-defined.
2020-07-04 11:03:46 -07:00
Marc Chevrier 9b9057bf69 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Marc Chevrier 37c3ef08bd Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> 2020-04-30 09:53:27 +02:00
Marc Chevrier 7e787876e3 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Marc Chevrier e1a83220ea CMake compilation: do not use compiler extensions
For now, compiler extensions are no longer activated on CMake sources.
However these extensions are still used for various third parties.

This MR is a partial answer to the issue #20454.
2020-03-23 10:29:58 +01:00
Marc Chevrier 1c811eaef0 STL support: make_unique can now handle array 2020-01-28 17:38:17 +01:00
Marc Chevrier c1e3c19988 Stl support: cm::append now supports any sequential container 2020-01-24 15:55:32 +01:00
Marc Chevrier df1566a2d4 STL Support: enhance behavior of cm::dynamic_reference_cast
Ensure cm::dynamic_reference_cast has same behavior as dynamic_cast
on reference: raise std::bad_cast if dynamic_cast is not possible.
2020-01-17 11:09:53 +01:00
Marc Chevrier 25393749f6 STL Support: extends type_traits for future developments 2020-01-17 11:09:48 +01:00
Marc Chevrier d8d0e9784f STL support: add c++20 std::erase and std::erase_if functions 2020-01-08 17:35:16 +01:00
Marc Chevrier cf9640f9d8 Refactoring: introduce header cmext/algorithm with append functions 2019-12-17 10:43:58 +01:00
Marc Chevrier 3c42febbde Memory management: cast functions for managed pointers 2019-11-27 16:03:04 +01:00
Kitware Robot 1344e43bcf Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Regina Pfeifer b52a569de9 cm/algorithm: Provide function cm::clamp 2019-09-25 10:30:58 +02:00
Marc Chevrier 62a3c5fdf7 cmstd: Extend header <cm/iterator> 2019-09-20 10:01:56 -04:00
Marc Chevrier df03251859 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00