summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-29 13:21:20 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-29 13:28:35 (GMT)
commit8a4ca110e49c64c4892a37ffe08a91a5a5219acf (patch)
treefc0ea487105b9ecee8c98d5c6c23dbafe4c77ed4 /Source/cmGlobalXCodeGenerator.cxx
parent83ad066ed10ccabc4331c4b620ad6a4fa0cd36ba (diff)
downloadCMake-8a4ca110e49c64c4892a37ffe08a91a5a5219acf.zip
CMake-8a4ca110e49c64c4892a37ffe08a91a5a5219acf.tar.gz
CMake-8a4ca110e49c64c4892a37ffe08a91a5a5219acf.tar.bz2
cmComputeLinkInformation: Improve type safety of item IsPath member
Use an enum to avoid implicit conversions to bool.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 009d133..693a11c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3454,7 +3454,9 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
libItem.Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
libItem.Target->GetType() == cmStateEnums::MODULE_LIBRARY ||
libItem.Target->GetType() == cmStateEnums::UNKNOWN_LIBRARY)) ||
- (!libItem.Target && libItem.IsPath && forceLinkPhase))) {
+ (!libItem.Target &&
+ libItem.IsPath == cmComputeLinkInformation::ItemIsPath::Yes &&
+ forceLinkPhase))) {
std::string libName;
bool canUseLinkPhase = true;
if (libItem.Target) {
@@ -3565,7 +3567,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
auto* libTarget = FindXCodeTarget(libItem->Target);
cmXCodeObject* buildFile;
if (!libTarget) {
- if (libItem->IsPath) {
+ if (libItem->IsPath == cmComputeLinkInformation::ItemIsPath::Yes) {
// Get or create a direct file ref in the root project
auto cleanPath = libItem->Value.Value;
if (cmSystemTools::FileIsFullPath(cleanPath)) {
@@ -3724,7 +3726,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
BuildObjectListOrString libPaths(this, true);
for (auto const& libItem : configItemMap[configName]) {
auto const& libName = *libItem;
- if (libName.IsPath) {
+ if (libName.IsPath == cmComputeLinkInformation::ItemIsPath::Yes) {
auto cleanPath = libName.Value.Value;
if (cmSystemTools::FileIsFullPath(cleanPath)) {
cleanPath = cmSystemTools::CollapseFullPath(cleanPath);