1. 16 Sep, 2019 1 commit
  2. 23 Aug, 2019 1 commit
  3. 22 Aug, 2019 1 commit
    • Sebastian Holtermann's avatar
      Source sweep: Use cmStrCat for string concatenation · 9b334397
      Sebastian Holtermann authored
      This patch is generated by a python script that uses regular expressions to
      search for string concatenation patterns of the kind
      
      ```
      std::string str = <ARG0>;
      str += <ARG1>;
      str += <ARG2>;
      ...
      ```
      
      and replaces them with a single `cmStrCat` call
      
      ```
      std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...);
      ```
      
      If any `<ARGX>` is itself a concatenated string of the kind
      
      ```
      a + b + c + ...;
      ```
      
      then `<ARGX>` is split into multiple arguments for the `cmStrCat` call.
      
      If there's a sequence of literals in the `<ARGX>`, then all literals in the
      sequence are concatenated and merged into a single literal argument for
      the `cmStrCat` call.
      
      Single character strings are converted to single char arguments for
      the `cmStrCat` call.
      
      `std::to_string(...)` wrappings are removed from `cmStrCat` arguments,
      because it supports numeric types as well as string types.
      
      `arg.substr(x)` arguments to `cmStrCat` are replaced with
      `cm::string_view(arg).substr(x)`
      9b334397
  4. 14 Aug, 2019 1 commit
  5. 09 Aug, 2019 1 commit
  6. 05 Aug, 2019 1 commit
  7. 30 Jul, 2019 1 commit
  8. 24 Jul, 2019 2 commits
    • Sebastian Holtermann's avatar
      cmMakefile: Let AddDefinition accept a value as cm::string_view · e91bfe44
      Sebastian Holtermann authored
      This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value
      argument instead of a `const char *`.
      
      Benefits are:
      - `std::string` can be passed to `cmMakefile::AddDefinition` directly without
        the `c_str()` plus string length recomputation fallback.
      - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at
        compile time.
      
      In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid
      `std::string::c_str` calls and the `std::string` is passed directly.
      Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might
      be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
      e91bfe44
    • Sebastian Holtermann's avatar
      cmMakefile: Simplify and rename AddDefinitionBool · f2ba968e
      Sebastian Holtermann authored
      This simplifies the `cmMakefile::AddDefinition` method with bool value
      overload to call the string based `cmMakefile::AddDefinition` method
      with either an "ON" or "OFF" string.
      Also the method is renamed to `cmMakefile::AddDefinitionBool`
      f2ba968e
  9. 17 Jul, 2019 1 commit
  10. 14 Jul, 2019 1 commit
  11. 22 May, 2019 1 commit
  12. 20 Feb, 2019 1 commit
  13. 11 Feb, 2019 1 commit
  14. 06 Feb, 2019 2 commits
  15. 29 Jan, 2019 1 commit
  16. 25 Jan, 2019 2 commits
  17. 23 Jan, 2019 1 commit
    • Kyle Edwards's avatar
      cmMakefile: Impose maximum recursion limit · a6982cff
      Kyle Edwards authored
      In order to keep infinitely-recursive scripts from causing a stack
      overflow in the CMake executable, CMake now imposes a maximum
      recursion limit before issuing an error message. The limit can be
      adjusted at runtime with CMAKE_MAXIMUM_RECURSION_DEPTH.
      
      Fixes: #18694
      a6982cff
  18. 17 Jan, 2019 3 commits
  19. 21 Nov, 2018 1 commit
  20. 03 Oct, 2018 1 commit
    • luz.paz's avatar
      Fix misc. typos · 6b4c5a03
      luz.paz authored
      Found via `codespell -q 3 -I ../cmake-whitelist.txt --skip="./Utilities"`
      where the whitelist consists of
      
      ```
      aci
      ans
      behaviour
      buil
      convertor
      dum
      earch
      ect
      emmited
      emmitted
      helpfull
      iff
      isnt
      ith
      lowercased
      mose
      nd
      nknown
      nto
      objext
      ot
      pathes
      pevents
      splitted
      substract
      superceded
      supercedes
      te
      tim
      todays
      uint
      upto
      whitespaces
      ```
      6b4c5a03
  21. 07 Aug, 2018 1 commit
    • Sebastian Holtermann's avatar
      cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` calls · b6802cd5
      Sebastian Holtermann authored
      After changing the ``cmGeneratedFileStream`` methods to accept
      ``std::string const&`` instead of ``const char*`` we don't
      need to call ``std::string::c_str`` anymore when passing
      a ``std::string`` to a ``cmGeneratedFileStream`` method.
      
      This patch removes all redundant ``std::string::c_str``
      calls when passing a string to a ``cmGeneratedFileStream`` method.
      
      It was generated by building CMake with clang-tidy enabled using
      the following options:
      
      -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
      b6802cd5
  22. 01 Jun, 2018 1 commit
    • Kitware Robot's avatar
      Revise C++ coding style using clang-format-6.0 · d7204e64
      Kitware Robot authored
      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.
      d7204e64
  23. 07 Mar, 2018 1 commit
  24. 31 Jan, 2018 1 commit
    • Pavel Solodovnikov's avatar
      Reduce raw string pointers usage. · 653b8946
      Pavel Solodovnikov authored
      * Change some functions to take `std::string` instead of
        `const char*` in the following classes: `cmMakeFile`, `cmake`,
        `cmCoreTryCompile`, `cmSystemTools`,  `cmState`, `cmLocalGenerator`
        and a few others.
      * Greatly reduce using of `const char*` overloads for
        `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`.
      * Remove many redundant `c_str()` conversions throughout the code.
      653b8946
  25. 26 Jan, 2018 1 commit
    • Kyle Edwards's avatar
      cmCTestScriptHandler: Add new field ShouldRunCurrentScript · 74092d92
      Kyle Edwards authored
      This is to avoid scope issues with CTEST_RUN_CURRENT_SCRIPT. If
      ctest_start() is called within a function scope, the value of
      CTEST_RUN_CURRENT_SCRIPT that it sets doesn't make it to the global
      scope. With this change, ctest_start() no longer sets
      CTEST_RUN_CURRENT_SCRIPT, and instead sets a field directly in
      cmCTestScriptHandler. The old behavior of CTEST_RUN_CURRENT_SCRIPT
      has also been kept for projects and tests that rely on setting it.
      74092d92
  26. 23 Jan, 2018 3 commits
    • Wouter Klouwen's avatar
      Make use of std::chrono throughout every component · e6a80ccf
      Wouter Klouwen authored
      This commit continues the changes made in CTest to support std::chrono
      by
      applying it throughout every component where a duration was used.
      
      No functional change intended.
      e6a80ccf
    • Wouter Klouwen's avatar
      CTest: add safe conversion from cmDuration to integer types · ff62b005
      Wouter Klouwen authored
      A problem area by recent refactoring of time to std::chrono has been the
      unsafe conversion from duration<double> to std::chrono::seconds, which
      is of an unspecified integer type.
      
      This commit adds a template function that for a given type provides a
      safe conversion, effectively clamping a duration<double> into what fits
      safely in that type. A specialisation for int and unsigned int are
      provided.
      
      It changes the protential problem areas to use this safe function.
      ff62b005
    • Wouter Klouwen's avatar
      CTest: introduce cmDuration · 695951bc
      Wouter Klouwen authored
      This commit introduces cmDuration as a typedef for
      std::chrono::duration<double, std::ratio<1>>. It is less verbose and
      provides for a point to put future common functionality for durations.
      
      No functional change intended.
      695951bc
  27. 11 Dec, 2017 1 commit
    • Brad King's avatar
      CTest: Use integer-representable value for "infinite" timeout · ba6caafa
      Brad King authored
      Refactoring in commit 66419bc0 (CTest: convert timeouts to
      std::chrono::duration, 2017-11-20) changed out "infinite" timeout to a
      value not representable by a 64-bit integer.  This causes undefined
      behavior when e.g. KWSys Process converts the duration to a `long` to
      interact with system APIs.  Use the old `1.0e7` maximum value.
      ba6caafa
  28. 04 Dec, 2017 1 commit
    • Wouter Klouwen's avatar
      CTest: convert timeouts to std::chrono::duration · 66419bc0
      Wouter Klouwen authored
      This commit continues the refactoring of CTest to adopt std::chrono.
      After the last sets of changes that introduced std::chrono::steady_clock
      and std::chrono::system_clock respectively, it makes sense to have all
      the timeouts be stored as std::chrono::duration.
      
      No functional change intended.
      66419bc0
  29. 28 Nov, 2017 1 commit
    • Brad King's avatar
      IWYU: Add mappings for std::enable_if on chrono durations · 923b8fad
      Brad King authored
      IWYU incorrectly classifies this internal STL type as not internal, and
      suggests including `<type_traits>` for it.  Work around the problem by
      mapping the offending names to a file that we always include.
      
      See include-what-you-use issue 434.
      923b8fad
  30. 14 Nov, 2017 1 commit
    • Wouter Klouwen's avatar
      CTest: use std::chrono::steady_clock for time keeping · e8a4036e
      Wouter Klouwen authored
      It was reported in issue #17345 that CTest does not use monotonic time
      to report test duration. Monotonic clocks are not affected by large NTP
      adjustments or things like daylight savings time.
      
      As CMake 3.10 requires C++11, which introduced std::chrono, this commit
      moves the time keeping in CTest from cmSystemTools::GetTime() to
      std::chrono::steady_clock.
      
      Fixes: #17345
      e8a4036e
  31. 03 Nov, 2017 1 commit
    • luz.paz's avatar
      Fix trivial typos in text · 777e87ae
      luz.paz authored
      Some are user facing.
      
      Found using
      
          codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`
      
      whereby the whitelist contained:
      
          ans
          dum
          helpfull
          emmited
          emmitted
          buil
          iff
          isnt
          nto
          ot
          pathes
          substract
          te
          todays
          upto
          whitespaces
      777e87ae
  32. 15 Sep, 2017 2 commits