https://github.com/Kitware/CMake
Revision 8d6a0b9364581fbb95746c93cac4ec3c213f534b authored by Brad King on 27 October 2020, 12:20:48 UTC, committed by Kitware Robot on 27 October 2020, 12:20:54 UTC
dd77dec18d VS: Don't compute CUDA options unless necessary
e9109dec36 Merge branch 'ninja-multi-per-config-sources' into release-3.18
7c0de4175b Merge branch 'cmake-E-cat-binary' into release-3.18

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5422
2 parent s 698851c + dd77dec
Raw File
Tip revision: 8d6a0b9364581fbb95746c93cac4ec3c213f534b authored by Brad King on 27 October 2020, 12:20:48 UTC
Merge topic 'cuda_vs_skip_computation' into release-3.19
Tip revision: 8d6a0b9
cmPropertyDefinition.cxx
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#include "cmPropertyDefinition.h"

#include <tuple>

cmPropertyDefinition::cmPropertyDefinition(std::string shortDescription,
                                           std::string fullDescription,
                                           bool chained)
  : ShortDescription(std::move(shortDescription))
  , FullDescription(std::move(fullDescription))
  , Chained(chained)
{
}

void cmPropertyDefinitionMap::DefineProperty(
  const std::string& name, cmProperty::ScopeType scope,
  const std::string& ShortDescription, const std::string& FullDescription,
  bool chain)
{
  auto it = this->Map_.find(key_type(name, scope));
  if (it == this->Map_.end()) {
    // try_emplace() since C++17
    this->Map_.emplace(
      std::piecewise_construct, std::forward_as_tuple(name, scope),
      std::forward_as_tuple(ShortDescription, FullDescription, chain));
  }
}

cmPropertyDefinition const* cmPropertyDefinitionMap::GetPropertyDefinition(
  const std::string& name, cmProperty::ScopeType scope) const
{
  auto it = this->Map_.find(key_type(name, scope));
  if (it != this->Map_.end()) {
    return &it->second;
  }

  return nullptr;
}
back to top