summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmPolicies: use `cmStrCat` for error message buildingBen Boeckel2023-07-241-84/+68
|
* cmPolicies: use `cmStrCat` for string additionsBen Boeckel2023-07-241-1/+1
|
* cmPolicies: use character literals where possibleBen Boeckel2023-07-241-2/+2
|
* cmPolicies: combine string literals where possibleBen Boeckel2023-07-241-22/+28
|
* Deprecate compatibility with CMake versions older than 3.5Brad King2023-02-111-3/+2
| | | | | | | | Issue a deprecation warning on calls to `cmake_minimum_required` or `cmake_policy` that set policies based on versions older than 3.5. Note that the effective policy version includes `...<max>` treatment. Update the check from commit 5845c218d7 (Deprecate compatibility with CMake versions older than 2.8.12, 2020-06-12, v3.19.0-rc1~629^2).
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-1/+1
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* clang-tidy: address `google-readability-casting` lintsBen Boeckel2022-05-241-2/+2
| | | | At least those involving `static_cast`.
* Source: fix many -Wmissing-prototypes warnings by marking functions staticSean McBride2021-10-251-1/+1
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-1/+1
|
* cmProp: refactoring: transform alias in classMarc Chevrier2021-08-081-0/+1
| | | | | | To handle safely the values used by CMake variables and properties, introduce the class cmProp as a replacement from the simple pointer to std::string instance.
* Deprecate compatibility with CMake versions older than 2.8.12Brad King2020-06-181-3/+27
| | | | | | | | Issue a deprecation warning on calls to `cmake_minimum_required` or `cmake_policy` that set policies based on versions older than 2.8.12. Note that the effective policy version includes `...<max>` treatment. This is important in combination with commit ca24b70d31 (Export: Specify a policy range in exported files, 2020-05-16, v3.18.0-rc1~133^2).
* clang-tidy: address bugprone-branch-clone lintsBen Boeckel2020-04-131-0/+2
| | | | | | | | | Arguably, many of these are bugs in `clang-tidy`. An if/else tree with other conditionals between cloned blocks may be relying on the intermediate logic to fall out of the case and inverting this logic may be non-trivial. See: https://bugs.llvm.org/show_bug.cgi?id=44165
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-7/+7
| | | | | 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.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-4/+4
|
* cmStringAlgorithms: Add cmStrToLong and cmStrToULongSebastian Holtermann2019-08-101-1/+1
| | | | | | | | This adds the following functions to cmStringAlgorithms: - `cmStrToLong`: moved from `cmSystemTools::StringToLong` - `cmStrToULong`: moved from `cmSystemTools::StringToULong` Overloads of the given functions for `std::string` are added as well.
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-1/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* Modernize: Enable modernize-raw-string-literal in clang-tidyArtur Ryt2019-04-021-1/+1
|
* Fix invalid ///! doxygen comment line startsSebastian Holtermann2019-03-311-3/+3
| | | | | In various places `///!` was used to start a comment line. This is not valid Doygen syntax. This patch replaces `///!` comment starts with `//!`.
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-8/+8
| | | | Reduce the number of files relying on `cmake.h`.
* cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-1/+1
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-15/+21
| | | | | | | | | | | | 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.
* cmake_minimum_required: Optionally set policies with version rangeBrad King2018-03-211-1/+38
| | | | | | | | Teach `cmake_minimum_required` and `cmake_policy(VERSION)` to support a version range of the form `<min>[...<max>]`. Define this to mean that version `<min>` is required, but known policies up to those introduced by `<max>` will be set to `NEW`. This will allow projects to easily specify a range of versions for which they have been updated.
* cmPolicies: Split parsing and impl of ApplyPolicyVersionBrad King2018-03-161-19/+28
| | | | Also rename local variables to clarify their role during parsing.
* cmPolicies: Drop unnecessary check from ApplyPolicyVersionBrad King2018-03-161-9/+3
| | | | This internal API is never called with `version_min` empty.
* cmPolicies: Pass policy version as std::stringBrad King2018-03-161-4/+5
|
* Replace empty-string comparisons with checking against `empty()`.Pavel Solodovnikov2017-09-211-1/+1
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-3/+2
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+0
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-6/+6
|
* Add deprecation warnings for policies CMP0036 and belowBrad King2017-04-211-0/+16
| | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for some policies to encourage projects to port away from setting policies to OLD.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | Include it in dependents which have previously relied on it transitively.
* cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-1/+1
| | | | Port dependent code to the change.
* surround macro arguments with parenthesesDaniel Pfeifer2016-09-051-3/+4
|
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-4/+8
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-1/+2
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-6/+6
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-169/+124
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* cmPolicies.cxx: Add missing include <ctype.h> for isdigit (#16066)Brad King2016-04-151-0/+1
|
* cmMakefile: Remove CMP0001 handling to callers.Stephen Kelly2015-07-251-0/+16
|
* cmPolicies: Store only state that users can set.Stephen Kelly2015-07-251-15/+1
| | | | | cmPolicies::PolicyMap does not need to store the REQUIRED_ALWAYS or REQUIRED_IF_USED states as they are statically determined.
* cmPolicies: Store all statuses in a single bitset.Stephen Kelly2015-06-071-13/+17
| | | | | | | | Currently there are an optimal number of policies (64) such that there are no wasted bits. When another policy is added, the cmPolicyMap will grow from 40 bytes to 80, and occupy 45. By storing all in a single bitset, we stay under the cache line size of 64 bytes until there are 512 policies in a range.
* cmPolicies: Replace UNDEFINED bitset with WARN bitset.Stephen Kelly2015-06-061-8/+5
| | | | Might as well use the existing concept.
* cmPolicies: Implement PolicyMap in terms of bitset.Stephen Kelly2015-05-041-4/+31
|
* cmPolicies: Implement abstraction for PolicyMap.Stephen Kelly2015-05-041-0/+22
| | | | Hide the detail that it is a std::map.
* cmPolicies: Make all API static.Stephen Kelly2015-05-041-1/+1
|