From a49751fb2eed0ca6415b243c35b23201b8060597 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 18 Oct 2016 21:28:46 +0200 Subject: cmState: Move TargetType enum to separate namespace --- Source/cmAddExecutableCommand.cxx | 6 +- Source/cmAddLibraryCommand.cxx | 63 ++++----- Source/cmCPluginAPI.cxx | 10 +- Source/cmCommonTargetGenerator.cxx | 2 +- Source/cmComputeLinkDepends.cxx | 4 +- Source/cmComputeLinkInformation.cxx | 45 +++--- Source/cmComputeTargetDepends.cxx | 20 +-- Source/cmCoreTryCompile.cxx | 37 ++--- Source/cmCoreTryCompile.h | 2 +- Source/cmCustomCommandGenerator.cxx | 6 +- Source/cmExportBuildAndroidMKGenerator.cxx | 24 ++-- Source/cmExportBuildFileGenerator.cxx | 8 +- Source/cmExportCommand.cxx | 4 +- Source/cmExportFileGenerator.cxx | 18 +-- Source/cmExportInstallAndroidMKGenerator.cxx | 2 +- Source/cmExportInstallFileGenerator.cxx | 6 +- Source/cmExportLibraryDependenciesCommand.cxx | 4 +- Source/cmExportTryCompileFileGenerator.cxx | 2 +- Source/cmExtraCodeBlocksGenerator.cxx | 42 +++--- Source/cmExtraCodeLiteGenerator.cxx | 32 ++--- Source/cmExtraEclipseCDT4Generator.cxx | 30 ++-- Source/cmExtraKateGenerator.cxx | 14 +- Source/cmExtraSublimeTextGenerator.cxx | 14 +- Source/cmGeneratorExpressionNode.cxx | 18 +-- Source/cmGeneratorTarget.cxx | 189 +++++++++++++------------- Source/cmGeneratorTarget.h | 4 +- Source/cmGhsMultiTargetGenerator.cxx | 8 +- Source/cmGlobalGenerator.cxx | 28 ++-- Source/cmGlobalKdevelopGenerator.cxx | 2 +- Source/cmGlobalNinjaGenerator.cxx | 32 +++-- Source/cmGlobalUnixMakefileGenerator3.cxx | 65 +++++---- Source/cmGlobalVisualStudio11Generator.cxx | 5 +- Source/cmGlobalVisualStudio11Generator.h | 2 +- Source/cmGlobalVisualStudio71Generator.cxx | 2 +- Source/cmGlobalVisualStudio71Generator.h | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 10 +- Source/cmGlobalVisualStudio7Generator.h | 2 +- Source/cmGlobalVisualStudio8Generator.cxx | 10 +- Source/cmGlobalVisualStudio8Generator.h | 4 +- Source/cmGlobalVisualStudioGenerator.cxx | 21 +-- Source/cmGlobalXCodeGenerator.cxx | 132 +++++++++--------- Source/cmGraphVizWriter.cxx | 18 +-- Source/cmGraphVizWriter.h | 2 +- Source/cmIncludeExternalMSProjectCommand.cxx | 4 +- Source/cmInstallCommand.cxx | 26 ++-- Source/cmInstallTargetGenerator.cxx | 44 +++--- Source/cmLinkLineComputer.cxx | 3 +- Source/cmLocalGenerator.cxx | 58 ++++---- Source/cmLocalGhsMultiGenerator.cxx | 2 +- Source/cmLocalNinjaGenerator.cxx | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 18 +-- Source/cmLocalVisualStudio10Generator.cxx | 2 +- Source/cmLocalVisualStudio7Generator.cxx | 77 +++++------ Source/cmLocalVisualStudioGenerator.cxx | 4 +- Source/cmMakefile.cxx | 47 ++++--- Source/cmMakefile.h | 8 +- Source/cmMakefileLibraryTargetGenerator.cxx | 34 ++--- Source/cmMakefileTargetGenerator.cxx | 24 ++-- Source/cmNinjaNormalTargetGenerator.cxx | 44 +++--- Source/cmNinjaTargetGenerator.cxx | 28 ++-- Source/cmNinjaUtilityTargetGenerator.cxx | 2 +- Source/cmServerProtocol.cxx | 2 +- Source/cmState.cxx | 20 +-- Source/cmState.h | 28 ++-- Source/cmTarget.cxx | 91 +++++++------ Source/cmTarget.h | 8 +- Source/cmTargetLinkLibrariesCommand.cxx | 16 +-- Source/cmTargetPropCommandBase.cxx | 14 +- Source/cmTargetPropertyComputer.cxx | 6 +- Source/cmTargetPropertyComputer.h | 12 +- Source/cmTestGenerator.cxx | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 106 ++++++++------- 72 files changed, 855 insertions(+), 828 deletions(-) diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index 96ad82a..a03d77d 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -133,8 +133,8 @@ bool cmAddExecutableCommand::InitialPass(std::vector const& args, this->SetError(e.str()); return false; } - cmState::TargetType type = aliasedTarget->GetType(); - if (type != cmState::EXECUTABLE) { + cmStateEnums::TargetType type = aliasedTarget->GetType(); + if (type != cmStateEnums::EXECUTABLE) { std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is not an " @@ -165,7 +165,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector const& args, } // Create the imported target. - this->Makefile->AddImportedTarget(exename, cmState::EXECUTABLE, + this->Makefile->AddImportedTarget(exename, cmStateEnums::EXECUTABLE, importGlobal); return true; } diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 26e38b8..d1281d4 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -15,10 +15,10 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, } // Library type defaults to value of BUILD_SHARED_LIBS, if it exists, // otherwise it defaults to static library. - cmState::TargetType type = cmState::SHARED_LIBRARY; + cmStateEnums::TargetType type = cmStateEnums::SHARED_LIBRARY; if (cmSystemTools::IsOff( this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) { - type = cmState::STATIC_LIBRARY; + type = cmStateEnums::STATIC_LIBRARY; } bool excludeFromAll = false; bool importTarget = false; @@ -38,57 +38,57 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, while (s != args.end()) { std::string libType = *s; if (libType == "STATIC") { - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting STATIC type."; this->SetError(e.str()); return false; } ++s; - type = cmState::STATIC_LIBRARY; + type = cmStateEnums::STATIC_LIBRARY; haveSpecifiedType = true; } else if (libType == "SHARED") { - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting SHARED type."; this->SetError(e.str()); return false; } ++s; - type = cmState::SHARED_LIBRARY; + type = cmStateEnums::SHARED_LIBRARY; haveSpecifiedType = true; } else if (libType == "MODULE") { - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting MODULE type."; this->SetError(e.str()); return false; } ++s; - type = cmState::MODULE_LIBRARY; + type = cmStateEnums::MODULE_LIBRARY; haveSpecifiedType = true; } else if (libType == "OBJECT") { - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting OBJECT type."; this->SetError(e.str()); return false; } ++s; - type = cmState::OBJECT_LIBRARY; + type = cmStateEnums::OBJECT_LIBRARY; haveSpecifiedType = true; } else if (libType == "UNKNOWN") { - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting UNKNOWN type."; this->SetError(e.str()); return false; } ++s; - type = cmState::UNKNOWN_LIBRARY; + type = cmStateEnums::UNKNOWN_LIBRARY; haveSpecifiedType = true; } else if (libType == "ALIAS") { - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; this->SetError(e.str()); @@ -116,10 +116,10 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, return false; } ++s; - type = cmState::INTERFACE_LIBRARY; + type = cmStateEnums::INTERFACE_LIBRARY; haveSpecifiedType = true; } else if (*s == "EXCLUDE_FROM_ALL") { - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; this->SetError(e.str()); @@ -133,7 +133,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, } else if (importTarget && *s == "GLOBAL") { ++s; importGlobal = true; - } else if (type == cmState::INTERFACE_LIBRARY && *s == "GLOBAL") { + } else if (type == cmStateEnums::INTERFACE_LIBRARY && *s == "GLOBAL") { std::ostringstream e; e << "GLOBAL option may only be used with IMPORTED libraries."; this->SetError(e.str()); @@ -143,7 +143,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, } } - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { if (s != args.end()) { std::ostringstream e; e << "INTERFACE library requires no source arguments."; @@ -170,7 +170,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, bool issueMessage = false; switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { case cmPolicies::WARN: - if (type != cmState::INTERFACE_LIBRARY) { + if (type != cmStateEnums::INTERFACE_LIBRARY) { e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0037) << "\n"; issueMessage = true; } @@ -233,12 +233,12 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, this->SetError(e.str()); return false; } - cmState::TargetType aliasedType = aliasedTarget->GetType(); - if (aliasedType != cmState::SHARED_LIBRARY && - aliasedType != cmState::STATIC_LIBRARY && - aliasedType != cmState::MODULE_LIBRARY && - aliasedType != cmState::OBJECT_LIBRARY && - aliasedType != cmState::INTERFACE_LIBRARY) { + cmStateEnums::TargetType aliasedType = aliasedTarget->GetType(); + if (aliasedType != cmStateEnums::SHARED_LIBRARY && + aliasedType != cmStateEnums::STATIC_LIBRARY && + aliasedType != cmStateEnums::MODULE_LIBRARY && + aliasedType != cmStateEnums::OBJECT_LIBRARY && + aliasedType != cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is not a library."; @@ -265,16 +265,17 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, CMAKE_${LANG}_CREATE_SHARED_LIBRARY is defined and if not default to STATIC. But at this point we know only the name of the target, but not yet its linker language. */ - if ((type == cmState::SHARED_LIBRARY || type == cmState::MODULE_LIBRARY) && + if ((type == cmStateEnums::SHARED_LIBRARY || + type == cmStateEnums::MODULE_LIBRARY) && (this->Makefile->GetState()->GetGlobalPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { std::ostringstream w; w << "ADD_LIBRARY called with " - << (type == cmState::SHARED_LIBRARY ? "SHARED" : "MODULE") + << (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE") << " option but the target platform does not support dynamic linking. " "Building a STATIC library instead. This may lead to problems."; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str()); - type = cmState::STATIC_LIBRARY; + type = cmStateEnums::STATIC_LIBRARY; } // Handle imported target creation. @@ -284,13 +285,13 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, this->SetError("called with IMPORTED argument but no library type."); return false; } - if (type == cmState::OBJECT_LIBRARY) { + if (type == cmStateEnums::OBJECT_LIBRARY) { this->Makefile->IssueMessage( cmake::FATAL_ERROR, "The OBJECT library type may not be used for IMPORTED libraries."); return true; } - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { if (!cmGeneratorExpression::IsValidTargetName(libName)) { std::ostringstream e; e << "Invalid name for IMPORTED INTERFACE library target: " << libName; @@ -314,7 +315,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, } // A non-imported target may not have UNKNOWN type. - if (type == cmState::UNKNOWN_LIBRARY) { + if (type == cmStateEnums::UNKNOWN_LIBRARY) { this->Makefile->IssueMessage( cmake::FATAL_ERROR, "The UNKNOWN library type may be used only for IMPORTED libraries."); @@ -332,7 +333,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, std::vector srclists; - if (type == cmState::INTERFACE_LIBRARY) { + if (type == cmStateEnums::INTERFACE_LIBRARY) { if (!cmGeneratorExpression::IsValidTargetName(libName) || libName.find("::") != std::string::npos) { std::ostringstream e; diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 56a469d..98e18ed 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -350,9 +350,9 @@ static void addLinkLibrary(cmMakefile* mf, std::string const& target, } cmTarget* tgt = mf->GetGlobalGenerator()->FindTarget(lib); - if (tgt && (tgt->GetType() != cmState::STATIC_LIBRARY) && - (tgt->GetType() != cmState::SHARED_LIBRARY) && - (tgt->GetType() != cmState::INTERFACE_LIBRARY) && + if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) && + (tgt->GetType() != cmStateEnums::SHARED_LIBRARY) && + (tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) && !tgt->IsExecutableWithExports()) { std::ostringstream e; e << "Target \"" << lib << "\" of type " @@ -393,8 +393,8 @@ void CCONV cmAddLibrary(void* arg, const char* libname, int shared, for (i = 0; i < numSrcs; ++i) { srcs2.push_back(srcs[i]); } - mf->AddLibrary(libname, - (shared ? cmState::SHARED_LIBRARY : cmState::STATIC_LIBRARY), + mf->AddLibrary(libname, (shared ? cmStateEnums::SHARED_LIBRARY + : cmStateEnums::STATIC_LIBRARY), srcs2); } diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index b995fa1..72556b8 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -171,7 +171,7 @@ std::vector cmCommonTargetGenerator::GetLinkedTargetDirectories() // We can ignore the INTERFACE_LIBRARY items because // Target->GetLinkInformation already processed their // link interface and they don't have any output themselves. - && linkee->GetType() != cmState::INTERFACE_LIBRARY && + && linkee->GetType() != cmStateEnums::INTERFACE_LIBRARY && emitted.insert(linkee).second) { cmLocalGenerator* lg = linkee->GetLocalGenerator(); std::string di = lg->GetCurrentBinaryDirectory(); diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 93f3289..804d900 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -262,7 +262,7 @@ cmComputeLinkDepends::Compute() LinkEntry const& e = this->EntryList[i]; cmGeneratorTarget const* t = e.Target; // Entries that we know the linker will re-use do not need to be repeated. - bool uniquify = t && t->GetType() == cmState::SHARED_LIBRARY; + bool uniquify = t && t->GetType() == cmStateEnums::SHARED_LIBRARY; if (!uniquify || emmitted.insert(i).second) { this->FinalLinkEntries.push_back(e); } @@ -345,7 +345,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe) if (cmLinkInterface const* iface = entry.Target->GetLinkInterface(this->Config, this->Target)) { const bool isIface = - entry.Target->GetType() == cmState::INTERFACE_LIBRARY; + entry.Target->GetType() == cmStateEnums::INTERFACE_LIBRARY; // This target provides its own link interface information. this->AddLinkEntries(depender_index, iface->Libraries); diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 0807ef8..565eb15 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -282,7 +282,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( // the program that will load it. this->LoaderFlag = CM_NULLPTR; if (!this->UseImportLibrary && - this->Target->GetType() == cmState::MODULE_LIBRARY) { + this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) { std::string loader_flag_var = "CMAKE_SHARED_MODULE_LOADER_"; loader_flag_var += this->LinkLanguage; loader_flag_var += "_FLAG"; @@ -299,10 +299,10 @@ cmComputeLinkInformation::cmComputeLinkInformation( // Get options needed to specify RPATHs. this->RuntimeUseChrpath = false; - if (this->Target->GetType() != cmState::STATIC_LIBRARY) { - const char* tType = - ((this->Target->GetType() == cmState::EXECUTABLE) ? "EXECUTABLE" - : "SHARED_LIBRARY"); + if (this->Target->GetType() != cmStateEnums::STATIC_LIBRARY) { + const char* tType = ((this->Target->GetType() == cmStateEnums::EXECUTABLE) + ? "EXECUTABLE" + : "SHARED_LIBRARY"); std::string rtVar = "CMAKE_"; rtVar += tType; rtVar += "_RUNTIME_"; @@ -446,10 +446,10 @@ cmComputeLinkInformation::GetSharedLibrariesLinked() bool cmComputeLinkInformation::Compute() { // Skip targets that do not link. - if (!(this->Target->GetType() == cmState::EXECUTABLE || - this->Target->GetType() == cmState::SHARED_LIBRARY || - this->Target->GetType() == cmState::MODULE_LIBRARY || - this->Target->GetType() == cmState::STATIC_LIBRARY)) { + if (!(this->Target->GetType() == cmStateEnums::EXECUTABLE || + this->Target->GetType() == cmStateEnums::SHARED_LIBRARY || + this->Target->GetType() == cmStateEnums::MODULE_LIBRARY || + this->Target->GetType() == cmStateEnums::STATIC_LIBRARY)) { return false; } @@ -498,7 +498,7 @@ bool cmComputeLinkInformation::Compute() i != wrongItems.end(); ++i) { cmGeneratorTarget const* tgt = *i; bool implib = (this->UseImportLibrary && - (tgt->GetType() == cmState::SHARED_LIBRARY)); + (tgt->GetType() == cmStateEnums::SHARED_LIBRARY)); std::string lib = tgt->GetFullPath(this->Config, implib, true); this->OldLinkDirItems.push_back(lib); } @@ -600,20 +600,21 @@ void cmComputeLinkInformation::AddItem(std::string const& item, linkItem += exe; this->Items.push_back(Item(linkItem, true, tgt)); this->Depends.push_back(exe); - } else if (tgt->GetType() == cmState::INTERFACE_LIBRARY) { + } else if (tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { // Add the interface library as an item so it can be considered as part // of COMPATIBLE_INTERFACE_ enforcement. The generators will ignore // this for the actual link line. this->Items.push_back(Item(std::string(), false, tgt)); } else { // Decide whether to use an import library. - bool implib = (this->UseImportLibrary && - (impexe || tgt->GetType() == cmState::SHARED_LIBRARY)); + bool implib = + (this->UseImportLibrary && + (impexe || tgt->GetType() == cmStateEnums::SHARED_LIBRARY)); // Pass the full path to the target file. std::string lib = tgt->GetFullPath(config, implib, true); if (!this->LinkDependsNoShared || - tgt->GetType() != cmState::SHARED_LIBRARY) { + tgt->GetType() != cmStateEnums::SHARED_LIBRARY) { this->Depends.push_back(lib); } @@ -652,7 +653,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item, if (tgt) { // The target will provide a full path. Make sure it is a shared // library. - if (tgt->GetType() != cmState::SHARED_LIBRARY) { + if (tgt->GetType() != cmStateEnums::SHARED_LIBRARY) { return; } } else { @@ -725,13 +726,13 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo() const char* shared_link_type_flag = CM_NULLPTR; const char* target_type_str = CM_NULLPTR; switch (this->Target->GetType()) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: target_type_str = "EXE"; break; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: target_type_str = "SHARED_LIBRARY"; break; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: target_type_str = "SHARED_MODULE"; break; default: @@ -964,12 +965,12 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item, // shared and static libraries but static-mode can handle only // static libraries. If a previous user item changed the link type // to static we need to make sure it is back to shared. - if (target->GetType() != cmState::STATIC_LIBRARY) { + if (target->GetType() != cmStateEnums::STATIC_LIBRARY) { this->SetCurrentLinkType(LinkShared); } // Keep track of shared library targets linked. - if (target->GetType() == cmState::SHARED_LIBRARY) { + if (target->GetType() == cmStateEnums::SHARED_LIBRARY) { this->SharedLibrariesLinked.insert(target); } @@ -1590,13 +1591,13 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo( // Libraries with unknown type must be handled using just the file // on disk. - if (target->GetType() == cmState::UNKNOWN_LIBRARY) { + if (target->GetType() == cmStateEnums::UNKNOWN_LIBRARY) { this->AddLibraryRuntimeInfo(fullPath); return; } // Skip targets that are not shared libraries (modules cannot be linked). - if (target->GetType() != cmState::SHARED_LIBRARY) { + if (target->GetType() != cmStateEnums::SHARED_LIBRARY) { return; } diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 735bc32..4cc4edf 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -187,7 +187,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) { // Get the depender. cmGeneratorTarget const* depender = this->Targets[depender_index]; - if (depender->GetType() == cmState::INTERFACE_LIBRARY) { + if (depender->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return; } @@ -212,10 +212,10 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) oi != objectFiles.end(); ++oi) { std::string objLib = (*oi)->GetObjectLibrary(); if (!objLib.empty() && emitted.insert(objLib).second) { - if (depender->GetType() != cmState::EXECUTABLE && - depender->GetType() != cmState::STATIC_LIBRARY && - depender->GetType() != cmState::SHARED_LIBRARY && - depender->GetType() != cmState::MODULE_LIBRARY) { + if (depender->GetType() != cmStateEnums::EXECUTABLE && + depender->GetType() != cmStateEnums::STATIC_LIBRARY && + depender->GetType() != cmStateEnums::SHARED_LIBRARY && + depender->GetType() != cmStateEnums::MODULE_LIBRARY) { this->GlobalGenerator->GetCMakeInstance()->IssueMessage( cmake::FATAL_ERROR, "Only executables and non-OBJECT libraries may " @@ -287,7 +287,7 @@ void cmComputeTargetDepends::AddInterfaceDepends( // Skip targets that will not really be linked. This is probably a // name conflict between an external library and an executable // within the project. - if (dependee && dependee->GetType() == cmState::EXECUTABLE && + if (dependee && dependee->GetType() == cmStateEnums::EXECUTABLE && !dependee->IsExecutableWithExports()) { dependee = CM_NULLPTR; } @@ -316,7 +316,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, cmGeneratorTarget const* dependee = dependee_name.Target; if (!dependee && !linking && - (depender->GetType() != cmState::GLOBAL_TARGET)) { + (depender->GetType() != cmStateEnums::GLOBAL_TARGET)) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; std::ostringstream e; @@ -351,7 +351,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, // Skip targets that will not really be linked. This is probably a // name conflict between an external library and an executable // within the project. - if (linking && dependee && dependee->GetType() == cmState::EXECUTABLE && + if (linking && dependee && dependee->GetType() == cmStateEnums::EXECUTABLE && !dependee->IsExecutableWithExports()) { dependee = CM_NULLPTR; } @@ -366,7 +366,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, bool linking) { if (dependee->IsImported() || - dependee->GetType() == cmState::INTERFACE_LIBRARY) { + dependee->GetType() == cmStateEnums::INTERFACE_LIBRARY) { // Skip IMPORTED and INTERFACE targets but follow their utility // dependencies. std::set const& utils = dependee->GetUtilityItems(); @@ -452,7 +452,7 @@ bool cmComputeTargetDepends::CheckComponents( // Make sure the component is all STATIC_LIBRARY targets. for (NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { - if (this->Targets[*ni]->GetType() != cmState::STATIC_LIBRARY) { + if (this->Targets[*ni]->GetType() != cmStateEnums::STATIC_LIBRARY) { this->ComplainAboutBadComponent(ccg, c); return false; } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index a409d40..cafba86 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -43,24 +43,25 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, // which signature were we called with ? this->SrcFileSignature = true; - cmState::TargetType targetType = cmState::EXECUTABLE; + cmStateEnums::TargetType targetType = cmStateEnums::EXECUTABLE; const char* tt = this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_TARGET_TYPE"); if (!isTryRun && tt && *tt) { - if (strcmp(tt, cmState::GetTargetTypeName(cmState::EXECUTABLE)) == 0) { - targetType = cmState::EXECUTABLE; + if (strcmp(tt, cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE)) == + 0) { + targetType = cmStateEnums::EXECUTABLE; } else if (strcmp(tt, cmState::GetTargetTypeName( - cmState::STATIC_LIBRARY)) == 0) { - targetType = cmState::STATIC_LIBRARY; + cmStateEnums::STATIC_LIBRARY)) == 0) { + targetType = cmStateEnums::STATIC_LIBRARY; } else { this->Makefile->IssueMessage( cmake::FATAL_ERROR, std::string("Invalid value '") + tt + "' for " "CMAKE_TRY_COMPILE_TARGET_TYPE. Only " "'" + - cmState::GetTargetTypeName(cmState::EXECUTABLE) + "' and " - "'" + - cmState::GetTargetTypeName(cmState::STATIC_LIBRARY) + + cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE) + "' and " + "'" + + cmState::GetTargetTypeName(cmStateEnums::STATIC_LIBRARY) + "' " "are allowed."); return -1; @@ -122,12 +123,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" "; if (cmTarget* tgt = this->Makefile->FindTargetToUse(argv[i])) { switch (tgt->GetType()) { - case cmState::SHARED_LIBRARY: - case cmState::STATIC_LIBRARY: - case cmState::INTERFACE_LIBRARY: - case cmState::UNKNOWN_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: + case cmStateEnums::UNKNOWN_LIBRARY: break; - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: if (tgt->IsExecutableWithExports()) { break; } @@ -481,13 +482,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv, ? "NEW" : "OLD"); - if (targetType == cmState::EXECUTABLE) { + if (targetType == cmStateEnums::EXECUTABLE) { /* Put the executable at a known location (for COPY_FILE). */ fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", this->BinaryDirectory.c_str()); /* Create the actual executable. */ fprintf(fout, "add_executable(%s", targetName.c_str()); - } else // if (targetType == cmState::STATIC_LIBRARY) + } else // if (targetType == cmStateEnums::STATIC_LIBRARY) { /* Put the static library at a known location (for COPY_FILE). */ fprintf(fout, "set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY \"%s\")\n", @@ -627,16 +628,16 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir) } void cmCoreTryCompile::FindOutputFile(const std::string& targetName, - cmState::TargetType targetType) + cmStateEnums::TargetType targetType) { this->FindErrorMessage = ""; this->OutputFile = ""; std::string tmpOutputFile = "/"; - if (targetType == cmState::EXECUTABLE) { + if (targetType == cmStateEnums::EXECUTABLE) { tmpOutputFile += targetName; tmpOutputFile += this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX"); - } else // if (targetType == cmState::STATIC_LIBRARY) + } else // if (targetType == cmStateEnums::STATIC_LIBRARY) { tmpOutputFile += this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX"); diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index e173a16..43b971f 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -35,7 +35,7 @@ protected: the error message is stored in FindErrorMessage. */ void FindOutputFile(const std::string& targetName, - cmState::TargetType targetType); + cmStateEnums::TargetType targetType); cmTypeMacro(cmCoreTryCompile, cmCommand); diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 0fd4ffb..5cb1104 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -42,7 +42,7 @@ bool cmCustomCommandGenerator::UseCrossCompilingEmulator(unsigned int c) const { std::string const& argv0 = this->CC.GetCommandLines()[c][0]; cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); - if (target && target->GetType() == cmState::EXECUTABLE) { + if (target && target->GetType() == cmStateEnums::EXECUTABLE) { return target->GetProperty("CROSSCOMPILING_EMULATOR") != CM_NULLPTR; } return false; @@ -52,12 +52,12 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const { std::string const& argv0 = this->CC.GetCommandLines()[c][0]; cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); - if (target && target->GetType() == cmState::EXECUTABLE && + if (target && target->GetType() == cmStateEnums::EXECUTABLE && (target->IsImported() || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) { return target->GetLocation(this->Config); } - if (target && target->GetType() == cmState::EXECUTABLE) { + if (target && target->GetType() == cmStateEnums::EXECUTABLE) { const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR"); if (emulator) { return std::string(emulator); diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index f5e6628..38f95d2 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -111,8 +111,8 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( target->GetLocalGenerator()->FindGeneratorTargetToUse(*i); if (gt) { - if (gt->GetType() == cmState::SHARED_LIBRARY || - gt->GetType() == cmState::MODULE_LIBRARY) { + if (gt->GetType() == cmStateEnums::SHARED_LIBRARY || + gt->GetType() == cmStateEnums::MODULE_LIBRARY) { sharedLibs += " " + *i; } else { staticLibs += " " + *i; @@ -168,7 +168,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( } // Tell the NDK build system if prebuilt static libraries use C++. - if (target->GetType() == cmState::STATIC_LIBRARY) { + if (target->GetType() == cmStateEnums::STATIC_LIBRARY) { cmLinkImplementation const* li = target->GetLinkImplementation(config); if (std::find(li->Languages.begin(), li->Languages.end(), "CXX") != li->Languages.end()) { @@ -177,19 +177,19 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( } switch (target->GetType()) { - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: os << "include $(PREBUILT_SHARED_LIBRARY)\n"; break; - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: os << "include $(PREBUILT_STATIC_LIBRARY)\n"; break; - case cmState::EXECUTABLE: - case cmState::UTILITY: - case cmState::OBJECT_LIBRARY: - case cmState::GLOBAL_TARGET: - case cmState::INTERFACE_LIBRARY: - case cmState::UNKNOWN_LIBRARY: + case cmStateEnums::EXECUTABLE: + case cmStateEnums::UTILITY: + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::GLOBAL_TARGET: + case cmStateEnums::INTERFACE_LIBRARY: + case cmStateEnums::UNKNOWN_LIBRARY: break; } os << "\n"; diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 68831c7..e5f7a55 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -57,7 +57,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) this->LG->GetMakefile()->GetBacktrace()); return false; } - if (te->GetType() == cmState::INTERFACE_LIBRARY) { + if (te->GetType() == cmStateEnums::INTERFACE_LIBRARY) { this->GenerateRequiredCMakeVersion(os, "3.0.0"); } } @@ -134,12 +134,12 @@ void cmExportBuildFileGenerator::GenerateImportTargetsConfig( cmGeneratorTarget* target = *tei; ImportPropertyMap properties; - if (target->GetType() != cmState::INTERFACE_LIBRARY) { + if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { this->SetImportLocationProperty(config, suffix, target, properties); } if (!properties.empty()) { // Get the rest of the target details. - if (target->GetType() != cmState::INTERFACE_LIBRARY) { + if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { this->SetImportDetailProperties(config, suffix, target, properties, missingTargets); this->SetImportLinkInterface(config, suffix, @@ -186,7 +186,7 @@ void cmExportBuildFileGenerator::SetImportLocationProperty( // Add the import library for windows DLLs. if (target->IsDLLPlatform() && - (target->GetType() == cmState::SHARED_LIBRARY || + (target->GetType() == cmStateEnums::SHARED_LIBRARY || target->IsExecutableWithExports()) && mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { std::string prop = "IMPORTED_IMPLIB"; diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index d438363..4fb5998 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -141,14 +141,14 @@ bool cmExportCommand::InitialPass(std::vector const& args, } if (cmTarget* target = gg->FindTarget(*currentTarget)) { - if (target->GetType() == cmState::OBJECT_LIBRARY) { + if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { std::ostringstream e; e << "given OBJECT library \"" << *currentTarget << "\" which may not be exported."; this->SetError(e.str()); return false; } - if (target->GetType() == cmState::UTILITY) { + if (target->GetType() == cmStateEnums::UTILITY) { this->SetError("given custom target \"" + *currentTarget + "\" which may not be exported."); return false; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index d3a99fa..3cd72a8 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -492,7 +492,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties( getPropertyContents(gtarget, "COMPATIBLE_INTERFACE_NUMBER_MAX", ifaceProperties); - if (gtarget->GetType() != cmState::INTERFACE_LIBRARY) { + if (gtarget->GetType() != cmStateEnums::INTERFACE_LIBRARY) { getCompatibleInterfaceProperties(gtarget, ifaceProperties, ""); std::vector configNames; @@ -735,8 +735,8 @@ void cmExportFileGenerator::SetImportDetailProperties( cmMakefile* mf = target->Makefile; // Add the soname for unix shared libraries. - if (target->GetType() == cmState::SHARED_LIBRARY || - target->GetType() == cmState::MODULE_LIBRARY) { + if (target->GetType() == cmStateEnums::SHARED_LIBRARY || + target->GetType() == cmStateEnums::MODULE_LIBRARY) { if (!target->IsDLLPlatform()) { std::string prop; std::string value; @@ -912,22 +912,22 @@ void cmExportFileGenerator::GenerateImportTargetCode( // Create the imported target. os << "# Create imported target " << targetName << "\n"; switch (target->GetType()) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: os << "add_executable(" << targetName << " IMPORTED)\n"; break; - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: os << "add_library(" << targetName << " STATIC IMPORTED)\n"; break; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: os << "add_library(" << targetName << " SHARED IMPORTED)\n"; break; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: os << "add_library(" << targetName << " MODULE IMPORTED)\n"; break; - case cmState::UNKNOWN_LIBRARY: + case cmStateEnums::UNKNOWN_LIBRARY: os << "add_library(" << targetName << " UNKNOWN IMPORTED)\n"; break; - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: os << "add_library(" << targetName << " INTERFACE IMPORTED)\n"; break; default: // should never happen diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 58b7510..f9f5f3a 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -38,7 +38,7 @@ void cmExportInstallAndroidMKGenerator::GenerateImportHeaderCode( tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei) { // Collect import properties for this target. cmTargetExport const* te = *tei; - if (te->Target->GetType() == cmState::INTERFACE_LIBRARY) { + if (te->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } std::string dest; diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 0e043de..92c3bf1 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -81,7 +81,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) cmGeneratorTarget* gt = (*tei)->Target; requiresConfigFiles = - requiresConfigFiles || gt->GetType() != cmState::INTERFACE_LIBRARY; + requiresConfigFiles || gt->GetType() != cmStateEnums::INTERFACE_LIBRARY; this->GenerateImportTargetCode(os, gt); @@ -120,7 +120,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) require2_8_12 = true; } } - if (gt->GetType() == cmState::INTERFACE_LIBRARY) { + if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { require3_0_0 = true; } if (gt->GetProperty("INTERFACE_SOURCES")) { @@ -316,7 +316,7 @@ void cmExportInstallFileGenerator::GenerateImportTargetsConfig( tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei) { // Collect import properties for this target. cmTargetExport const* te = *tei; - if (te->Target->GetType() == cmState::INTERFACE_LIBRARY) { + if (te->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index f80980a..66b77a6 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -79,8 +79,8 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const cmTarget const& target = l->second; // Skip non-library targets. - if (target.GetType() < cmState::STATIC_LIBRARY || - target.GetType() > cmState::MODULE_LIBRARY) { + if (target.GetType() < cmStateEnums::STATIC_LIBRARY || + target.GetType() > cmStateEnums::MODULE_LIBRARY) { continue; } diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index 9fc71f6..a262e14 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -67,7 +67,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets( CM_AUTO_PTR cge = ge.Parse(prop); - cmTarget dummyHead("try_compile_dummy_exe", cmState::EXECUTABLE, + cmTarget dummyHead("try_compile_dummy_exe", cmStateEnums::EXECUTABLE, cmTarget::VisibilityNormal, tgt->Target->GetMakefile()); cmGeneratorTarget gDummyHead(&dummyHead, tgt->GetLocalGenerator()); diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 18c732d..b91cae9 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -302,7 +302,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( ti != targets.end(); ti++) { std::string targetName = (*ti)->GetName(); switch ((*ti)->GetType()) { - case cmState::GLOBAL_TARGET: { + case cmStateEnums::GLOBAL_TARGET: { // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs if (strcmp((*lg)->GetCurrentBinaryDirectory(), @@ -311,7 +311,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( compiler.c_str(), makeArgs); } } break; - case cmState::UTILITY: + case cmStateEnums::UTILITY: // Add all utility targets, except the Nightly/Continuous/ // Experimental-"sub"targets as e.g. NightlyStart if (((targetName.find("Nightly") == 0) && @@ -326,11 +326,11 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg, compiler.c_str(), makeArgs); break; - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: { cmGeneratorTarget* gt = *ti; this->AppendTarget(xml, targetName, gt, make.c_str(), *lg, compiler.c_str(), makeArgs); @@ -364,12 +364,12 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( for (std::vector::iterator ti = targets.begin(); ti != targets.end(); ti++) { switch ((*ti)->GetType()) { - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: - case cmState::UTILITY: // can have sources since 2.6.3 + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::UTILITY: // can have sources since 2.6.3 { std::vector sources; cmGeneratorTarget* gt = *ti; @@ -379,7 +379,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( si != sources.end(); si++) { // don't add source files from UTILITY target which have the // GENERATED property set: - if (gt->GetType() == cmState::UTILITY && + if (gt->GetType() == cmStateEnums::UTILITY && (*si)->GetPropertyAsBool("GENERATED")) { continue; } @@ -519,7 +519,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget( if (target != CM_NULLPTR) { int cbTargetType = this->GetCBTargetType(target); std::string workingDir = lg->GetCurrentBinaryDirectory(); - if (target->GetType() == cmState::EXECUTABLE) { + if (target->GetType() == cmStateEnums::EXECUTABLE) { // Determine the directory where the executable target is created, and // set the working directory to this dir. const char* runtimeOutputDir = @@ -537,7 +537,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget( std::string buildType = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); std::string location; - if (target->GetType() == cmState::OBJECT_LIBRARY) { + if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { location = this->CreateDummyTargetFile(const_cast(lg), target); } else { @@ -713,17 +713,17 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf) int cmExtraCodeBlocksGenerator::GetCBTargetType(cmGeneratorTarget* target) { switch (target->GetType()) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: if ((target->GetPropertyAsBool("WIN32_EXECUTABLE")) || (target->GetPropertyAsBool("MACOSX_BUNDLE"))) { return 0; } return 1; - case cmState::STATIC_LIBRARY: - case cmState::OBJECT_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: return 2; - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: return 3; default: return 4; diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index 360c852..90d41fe 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -127,7 +127,7 @@ std::vector cmExtraCodeLiteGenerator::CreateProjectsByTarget( for (std::vector::const_iterator lt = (*lg)->GetGeneratorTargets().begin(); lt != (*lg)->GetGeneratorTargets().end(); lt++) { - cmState::TargetType type = (*lt)->GetType(); + cmStateEnums::TargetType type = (*lt)->GetType(); std::string outputDir = (*lg)->GetCurrentBinaryDirectory(); std::string filename = outputDir + "/" + (*lt)->GetName() + ".project"; retval.push_back((*lt)->GetName()); @@ -136,11 +136,11 @@ std::vector cmExtraCodeLiteGenerator::CreateProjectsByTarget( this->WorkspacePath.c_str(), filename.c_str()); std::string visualname = (*lt)->GetName(); switch (type) { - case cmState::SHARED_LIBRARY: - case cmState::STATIC_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: visualname = "lib" + visualname; - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: xml->StartElement("Project"); xml->Attribute("Name", visualname); xml->Attribute("Path", relafilename); @@ -209,16 +209,16 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles( std::string projectType; switch (gt->GetType()) { - case cmState::EXECUTABLE: { + case cmStateEnums::EXECUTABLE: { projectType = "Executable"; } break; - case cmState::STATIC_LIBRARY: { + case cmStateEnums::STATIC_LIBRARY: { projectType = "Static Library"; } break; - case cmState::SHARED_LIBRARY: { + case cmStateEnums::SHARED_LIBRARY: { projectType = "Dynamic Library"; } break; - case cmState::MODULE_LIBRARY: { + case cmStateEnums::MODULE_LIBRARY: { projectType = "Dynamic Library"; } break; default: // intended fallthrough @@ -226,10 +226,10 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles( } switch (gt->GetType()) { - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: { std::vector sources; gt->GetSourceFiles(sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); @@ -511,9 +511,9 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile( xml.StartElement("CodeLite_Project"); std::string visualname = gt->GetName(); switch (gt->GetType()) { - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: visualname = "lib" + visualname; default: // intended fallthrough break; diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index e342f4c..7535e8c 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -482,13 +482,14 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml) std::string linkName2 = linkName; linkName2 += "/"; switch ((*ti)->GetType()) { - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: { const char* prefix = - ((*ti)->GetType() == cmState::EXECUTABLE ? "[exe] " : "[lib] "); + ((*ti)->GetType() == cmStateEnums::EXECUTABLE ? "[exe] " + : "[lib] "); linkName2 += prefix; linkName2 += (*ti)->GetName(); this->AppendLinkedResource(xml, linkName2, "virtual:/virtual", @@ -912,14 +913,14 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const ti != targets.end(); ++ti) { std::string targetName = (*ti)->GetName(); switch ((*ti)->GetType()) { - case cmState::GLOBAL_TARGET: { + case cmStateEnums::GLOBAL_TARGET: { // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs if (subdir.empty()) { this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": "); } } break; - case cmState::UTILITY: + case cmStateEnums::UTILITY: // Add all utility targets, except the Nightly/Continuous/ // Experimental-"sub"targets as e.g. NightlyStart if (((targetName.find("Nightly") == 0) && @@ -933,13 +934,14 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": "); break; - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: { const char* prefix = - ((*ti)->GetType() == cmState::EXECUTABLE ? "[exe] " : "[lib] "); + ((*ti)->GetType() == cmStateEnums::EXECUTABLE ? "[exe] " + : "[lib] "); this->AppendTarget(xml, targetName, make, makeArgs, subdir, prefix); std::string fastTarget = targetName; fastTarget += "/fast"; diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index b78d09a..3f09469 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -124,7 +124,7 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg, ti != targets.end(); ++ti) { std::string targetName = (*ti)->GetName(); switch ((*ti)->GetType()) { - case cmState::GLOBAL_TARGET: { + case cmStateEnums::GLOBAL_TARGET: { bool insertTarget = false; // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs @@ -147,7 +147,7 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg, homeOutputDir); } } break; - case cmState::UTILITY: + case cmStateEnums::UTILITY: // Add all utility targets, except the Nightly/Continuous/ // Experimental-"sub"targets as e.g. NightlyStart if (((targetName.find("Nightly") == 0) && @@ -162,11 +162,11 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg, this->AppendTarget(fout, targetName, make, makeArgs, currentDir, homeOutputDir); break; - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: { this->AppendTarget(fout, targetName, make, makeArgs, currentDir, homeOutputDir); std::string fastTarget = targetName; diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 41f82a2..9a83c49 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -156,7 +156,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( ti != targets.end(); ti++) { std::string targetName = (*ti)->GetName(); switch ((*ti)->GetType()) { - case cmState::GLOBAL_TARGET: { + case cmStateEnums::GLOBAL_TARGET: { // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs if (strcmp((*lg)->GetCurrentBinaryDirectory(), @@ -166,7 +166,7 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( false); } } break; - case cmState::UTILITY: + case cmStateEnums::UTILITY: // Add all utility targets, except the Nightly/Continuous/ // Experimental-"sub"targets as e.g. NightlyStart if (((targetName.find("Nightly") == 0) && @@ -182,11 +182,11 @@ void cmExtraSublimeTextGenerator::AppendAllTargets( makefile, compiler.c_str(), sourceFileFlags, false); break; - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: { this->AppendTarget(fout, targetName, *lg, *ti, make.c_str(), makefile, compiler.c_str(), sourceFileFlags, false); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index f866605..f34b2d6 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -1104,7 +1104,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode if (!prop) { if (target->IsImported() || - target->GetType() == cmState::INTERFACE_LIBRARY) { + target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return linkedTargetsContent; } if (target->IsLinkInterfaceDependentBoolProperty(propertyName, @@ -1224,7 +1224,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode reportError(context, content->GetOriginalExpression(), e.str()); return std::string(); } - if (gt->GetType() != cmState::OBJECT_LIBRARY) { + if (gt->GetType() != cmStateEnums::OBJECT_LIBRARY) { std::ostringstream e; e << "Objects of target \"" << tgtName << "\" referenced but is not an OBJECT library."; @@ -1506,7 +1506,7 @@ struct TargetFilesystemArtifactResultCreator "for DLL target platforms."); return std::string(); } - if (target->GetType() != cmState::SHARED_LIBRARY) { + if (target->GetType() != cmStateEnums::SHARED_LIBRARY) { ::reportError(context, content->GetOriginalExpression(), "TARGET_SONAME_FILE is allowed only for " "SHARED libraries."); @@ -1542,11 +1542,11 @@ struct TargetFilesystemArtifactResultCreator return std::string(); } - cmState::TargetType targetType = target->GetType(); + cmStateEnums::TargetType targetType = target->GetType(); - if (targetType != cmState::SHARED_LIBRARY && - targetType != cmState::MODULE_LIBRARY && - targetType != cmState::EXECUTABLE) { + if (targetType != cmStateEnums::SHARED_LIBRARY && + targetType != cmStateEnums::MODULE_LIBRARY && + targetType != cmStateEnums::EXECUTABLE) { ::reportError(context, content->GetOriginalExpression(), "TARGET_PDB_FILE is allowed only for " "targets with linker created artifacts."); @@ -1646,8 +1646,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode "No target \"" + name + "\""); return std::string(); } - if (target->GetType() >= cmState::OBJECT_LIBRARY && - target->GetType() != cmState::UNKNOWN_LIBRARY) { + if (target->GetType() >= cmStateEnums::OBJECT_LIBRARY && + target->GetType() != cmStateEnums::UNKNOWN_LIBRARY) { ::reportError(context, content->GetOriginalExpression(), "Target \"" + name + "\" is not an executable or library."); return std::string(); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index b16cfc6..8324c30 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -215,7 +215,7 @@ struct TagVisitor , Target(target) , GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()) , Header(CM_HEADER_REGEX) - , IsObjLib(target->GetType() == cmState::OBJECT_LIBRARY) + , IsObjLib(target->GetType() == cmStateEnums::OBJECT_LIBRARY) { } @@ -230,7 +230,7 @@ struct TagVisitor std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); if (sf->GetCustomCommand()) { DoAccept::Result>::Do(this->Data, sf); - } else if (this->Target->GetType() == cmState::UTILITY) { + } else if (this->Target->GetType() == cmStateEnums::UTILITY) { DoAccept::Result>::Do(this->Data, sf); } else if (sf->GetPropertyAsBool("HEADER_FILE_ONLY")) { DoAccept::Result>::Do(this->Data, sf); @@ -368,7 +368,7 @@ cmLocalGenerator* cmGeneratorTarget::GetLocalGenerator() const return this->LocalGenerator; } -cmState::TargetType cmGeneratorTarget::GetType() const +cmStateEnums::TargetType cmGeneratorTarget::GetType() const { return this->Target->GetType(); } @@ -415,7 +415,7 @@ const char* cmGeneratorTarget::GetProperty(const std::string& prop) const const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const { switch (this->GetType()) { - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: if (this->IsDLLPlatform()) { if (implib) { // A DLL import library is treated as an archive target. @@ -428,10 +428,10 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const // library targets. return "LIBRARY"; } - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: // Static libraries are always treated as archive targets. return "ARCHIVE"; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: if (implib) { // Module libraries are always treated as library targets. return "ARCHIVE"; @@ -439,7 +439,7 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const // Module import libraries are treated as archive targets. return "LIBRARY"; } - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: if (implib) { // Executable import libraries are treated as archive targets. return "ARCHIVE"; @@ -845,7 +845,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const bool cmGeneratorTarget::IsSystemIncludeDirectory( const std::string& dir, const std::string& config) const { - assert(this->GetType() != cmState::INTERFACE_LIBRARY); + assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); std::string config_upper; if (!config.empty()) { config_upper = cmSystemTools::UpperCase(config); @@ -1006,7 +1006,7 @@ static bool processSources( void cmGeneratorTarget::GetSourceFiles(std::vector& files, const std::string& config) const { - assert(this->GetType() != cmState::INTERFACE_LIBRARY); + assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); if (!this->LocalGenerator->GetGlobalGenerator()->GetConfigureDoneCMP0026()) { // At configure-time, this method can be called as part of getting the @@ -1151,7 +1151,7 @@ bool cmGeneratorTarget::HasSOName(const std::string& config) const { // soname is supported only for shared libraries and modules, // and then only when the platform supports an soname flag. - return ((this->GetType() == cmState::SHARED_LIBRARY) && + return ((this->GetType() == cmStateEnums::SHARED_LIBRARY) && !this->GetPropertyAsBool("NO_SONAME") && this->Makefile->GetSONameFlag(this->GetLinkerLanguage(config))); } @@ -1161,9 +1161,9 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall( { // Only executables and shared libraries can have an rpath and may // need relinking. - if (this->GetType() != cmState::EXECUTABLE && - this->GetType() != cmState::SHARED_LIBRARY && - this->GetType() != cmState::MODULE_LIBRARY) { + if (this->GetType() != cmStateEnums::EXECUTABLE && + this->GetType() != cmStateEnums::SHARED_LIBRARY && + this->GetType() != cmStateEnums::MODULE_LIBRARY) { return false; } @@ -1235,9 +1235,9 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall( bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const { // Only certain target types have an rpath. - if (!(this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::MODULE_LIBRARY || - this->GetType() == cmState::EXECUTABLE)) { + if (!(this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::MODULE_LIBRARY || + this->GetType() == cmStateEnums::EXECUTABLE)) { return false; } @@ -1292,7 +1292,7 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const bool cmGeneratorTarget::IsImportedSharedLibWithoutSOName( const std::string& config) const { - if (this->IsImported() && this->GetType() == cmState::SHARED_LIBRARY) { + if (this->IsImported() && this->GetType() == cmStateEnums::SHARED_LIBRARY) { if (cmGeneratorTarget::ImportInfo const* info = this->GetImportInfo(config)) { return info->NoSOName; @@ -1308,7 +1308,7 @@ bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir( bool macosx_rpath = false; if (!this->IsImported()) { - if (this->GetType() != cmState::SHARED_LIBRARY) { + if (this->GetType() != cmStateEnums::SHARED_LIBRARY) { return false; } const char* install_name = this->GetProperty("INSTALL_NAME_DIR"); @@ -1562,17 +1562,17 @@ const cmListFileBacktrace* cmGeneratorTarget::GetUtilityBacktrace( bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const { - return this->GetType() == cmState::STATIC_LIBRARY || - this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::MODULE_LIBRARY || - this->GetType() == cmState::EXECUTABLE; + return this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::MODULE_LIBRARY || + this->GetType() == cmStateEnums::EXECUTABLE; } const char* cmGeneratorTarget::GetExportMacro() const { // Define the symbol for targets that export symbols. - if (this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::MODULE_LIBRARY || + if (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::MODULE_LIBRARY || this->IsExecutableWithExports()) { if (const char* custom_export_name = this->GetProperty("DEFINE_SYMBOL")) { this->ExportMacro = custom_export_name; @@ -1846,7 +1846,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo( return CM_NULLPTR; } - if (this->GetType() > cmState::OBJECT_LIBRARY) { + if (this->GetType() > cmStateEnums::OBJECT_LIBRARY) { std::string msg = "cmTarget::GetCompileInfo called for "; msg += this->GetName(); msg += " which has type "; @@ -2023,7 +2023,7 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target) this->CurrentEntry = CM_NULLPTR; // Queue all the source files already specified for the target. - if (target->GetType() != cmState::INTERFACE_LIBRARY) { + if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { std::vector configs; this->Makefile->GetConfigurations(configs); if (configs.empty()) { @@ -2158,8 +2158,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep) // then make sure it was not a full path to something else, and // the fact that the name matched a target was just a coincidence. if (cmSystemTools::FileIsFullPath(dep.c_str())) { - if (t->GetType() >= cmState::EXECUTABLE && - t->GetType() <= cmState::MODULE_LIBRARY) { + if (t->GetType() >= cmStateEnums::EXECUTABLE && + t->GetType() <= cmStateEnums::MODULE_LIBRARY) { // This is really only for compatibility so we do not need to // worry about configuration names and output names. std::string tLocation = t->GetLocationForBuild(); @@ -2199,7 +2199,7 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc) // Check for a target with this name. if (cmGeneratorTarget* t = this->LocalGenerator->FindGeneratorTargetToUse(command)) { - if (t->GetType() == cmState::EXECUTABLE) { + if (t->GetType() == cmStateEnums::EXECUTABLE) { // The command refers to an executable target built in // this project. Add the target-level dependency to make // sure the executable is up to date before this custom @@ -2273,7 +2273,7 @@ void cmGeneratorTarget::TraceDependencies() // would find nothing anyway, but when building CMake itself the "install" // target command ends up referencing the "cmake" target but we do not // really want the dependency because "install" depend on "all" anyway. - if (this->GetType() == cmState::GLOBAL_TARGET) { + if (this->GetType() == cmStateEnums::GLOBAL_TARGET) { return; } @@ -2312,7 +2312,7 @@ std::string cmGeneratorTarget::GetCreateRuleVariable( std::string const& lang, std::string const& config) const { switch (this->GetType()) { - case cmState::STATIC_LIBRARY: { + case cmStateEnums::STATIC_LIBRARY: { std::string var = "CMAKE_" + lang + "_CREATE_STATIC_LIBRARY"; if (this->GetFeatureAsBool("INTERPROCEDURAL_OPTIMIZATION", config)) { std::string varIPO = var + "_IPO"; @@ -2322,11 +2322,11 @@ std::string cmGeneratorTarget::GetCreateRuleVariable( } return var; } - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return "CMAKE_" + lang + "_CREATE_SHARED_LIBRARY"; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: return "CMAKE_" + lang + "_CREATE_SHARED_MODULE"; - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return "CMAKE_" + lang + "_LINK_EXECUTABLE"; default: break; @@ -2753,11 +2753,11 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const std::string realName; std::string impName; std::string pdbName; - if (this->GetType() == cmState::EXECUTABLE) { + if (this->GetType() == cmStateEnums::EXECUTABLE) { this->GetExecutableNames(name, realName, impName, pdbName, config); - } else if (this->GetType() == cmState::STATIC_LIBRARY || - this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::MODULE_LIBRARY) { + } else if (this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::MODULE_LIBRARY) { this->GetLibraryNames(name, soName, realName, impName, pdbName, config); } else { return; @@ -2843,7 +2843,7 @@ std::string cmGeneratorTarget::NormalGetRealName( this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg); } - if (this->GetType() == cmState::EXECUTABLE) { + if (this->GetType() == cmStateEnums::EXECUTABLE) { // Compute the real name that will be built. std::string name; std::string realName; @@ -2926,8 +2926,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName, } // The import library name. - if (this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::MODULE_LIBRARY) { + if (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::MODULE_LIBRARY) { impName = this->GetFullNameInternal(config, true); } else { impName = ""; @@ -2959,7 +2959,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name, #else // Check for executable version properties. const char* version = this->GetProperty("VERSION"); - if (this->GetType() != cmState::EXECUTABLE || + if (this->GetType() != cmStateEnums::EXECUTABLE || this->Makefile->IsOn("XCODE")) { version = CM_NULLPTR; } @@ -3028,10 +3028,10 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config, std::string& outSuffix) const { // Use just the target name for non-main target types. - if (this->GetType() != cmState::STATIC_LIBRARY && - this->GetType() != cmState::SHARED_LIBRARY && - this->GetType() != cmState::MODULE_LIBRARY && - this->GetType() != cmState::EXECUTABLE) { + if (this->GetType() != cmStateEnums::STATIC_LIBRARY && + this->GetType() != cmStateEnums::SHARED_LIBRARY && + this->GetType() != cmStateEnums::MODULE_LIBRARY && + this->GetType() != cmStateEnums::EXECUTABLE) { outPrefix = ""; outBase = this->GetName(); outSuffix = ""; @@ -3050,9 +3050,9 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config, // The implib option is only allowed for shared libraries, module // libraries, and executables. - if (this->GetType() != cmState::SHARED_LIBRARY && - this->GetType() != cmState::MODULE_LIBRARY && - this->GetType() != cmState::EXECUTABLE) { + if (this->GetType() != cmStateEnums::SHARED_LIBRARY && + this->GetType() != cmStateEnums::MODULE_LIBRARY && + this->GetType() != cmStateEnums::EXECUTABLE) { implib = false; } @@ -3130,7 +3130,7 @@ void cmGeneratorTarget::GetFullNameInternal(const std::string& config, // Name shared libraries with their version number on some platforms. if (const char* soversion = this->GetProperty("SOVERSION")) { - if (this->GetType() == cmState::SHARED_LIBRARY && !implib && + if (this->GetType() == cmStateEnums::SHARED_LIBRARY && !implib && this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION")) { outBase += "-"; outBase += soversion; @@ -3296,8 +3296,8 @@ cmGeneratorTarget::GetCompatibleInterfaces(std::string const& config) const bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty( const std::string& p, const std::string& config) const { - if (this->GetType() == cmState::OBJECT_LIBRARY || - this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::OBJECT_LIBRARY || + this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return false; } return this->GetCompatibleInterfaces(config).PropsBool.count(p) > 0; @@ -3306,8 +3306,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentBoolProperty( bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty( const std::string& p, const std::string& config) const { - if (this->GetType() == cmState::OBJECT_LIBRARY || - this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::OBJECT_LIBRARY || + this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return false; } return this->GetCompatibleInterfaces(config).PropsString.count(p) > 0; @@ -3316,8 +3316,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentStringProperty( bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty( const std::string& p, const std::string& config) const { - if (this->GetType() == cmState::OBJECT_LIBRARY || - this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::OBJECT_LIBRARY || + this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return false; } return this->GetCompatibleInterfaces(config).PropsNumberMin.count(p) > 0; @@ -3326,8 +3326,8 @@ bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMinProperty( bool cmGeneratorTarget::IsLinkInterfaceDependentNumberMaxProperty( const std::string& p, const std::string& config) const { - if (this->GetType() == cmState::OBJECT_LIBRARY || - this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::OBJECT_LIBRARY || + this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return false; } return this->GetCompatibleInterfaces(config).PropsNumberMax.count(p) > 0; @@ -3921,7 +3921,7 @@ void cmGeneratorTarget::GetTargetVersion(bool soversion, int& major, minor = 0; patch = 0; - assert(this->GetType() != cmState::INTERFACE_LIBRARY); + assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); // Look for a VERSION or SOVERSION property. const char* prop = soversion ? "SOVERSION" : "VERSION"; @@ -3993,7 +3993,7 @@ std::string cmGeneratorTarget::CreateFortranModuleDirectory( std::string cmGeneratorTarget::GetFrameworkVersion() const { - assert(this->GetType() != cmState::INTERFACE_LIBRARY); + assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); if (const char* fversion = this->GetProperty("FRAMEWORK_VERSION")) { return fversion; @@ -4109,7 +4109,7 @@ cmLinkInterface const* cmGeneratorTarget::GetLinkInterface( // Link interfaces are not supported for executables that do not // export symbols. - if (this->GetType() == cmState::EXECUTABLE && + if (this->GetType() == cmStateEnums::EXECUTABLE && !this->IsExecutableWithExports()) { return CM_NULLPTR; } @@ -4143,9 +4143,9 @@ void cmGeneratorTarget::ComputeLinkInterface( cmGeneratorTarget const* headTarget) const { if (iface.ExplicitLibraries) { - if (this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::STATIC_LIBRARY || - this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { // Shared libraries may have runtime implementation dependencies // on other shared libraries that are not in the interface. UNORDERED_SET emitted; @@ -4154,7 +4154,7 @@ void cmGeneratorTarget::ComputeLinkInterface( li != iface.Libraries.end(); ++li) { emitted.insert(*li); } - if (this->GetType() != cmState::INTERFACE_LIBRARY) { + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) { cmLinkImplementation const* impl = this->GetLinkImplementation(config); for (std::vector::const_iterator li = impl->Libraries.begin(); @@ -4162,7 +4162,7 @@ void cmGeneratorTarget::ComputeLinkInterface( if (emitted.insert(*li).second) { if (li->Target) { // This is a runtime dependency on another shared library. - if (li->Target->GetType() == cmState::SHARED_LIBRARY) { + if (li->Target->GetType() == cmStateEnums::SHARED_LIBRARY) { iface.SharedDeps.push_back(*li); } } else { @@ -4192,7 +4192,7 @@ void cmGeneratorTarget::ComputeLinkInterface( } } - if (this->GetType() == cmState::STATIC_LIBRARY) { + if (this->GetType() == cmStateEnums::STATIC_LIBRARY) { // Construct the property name suffix for this configuration. std::string suffix = "_"; if (!config.empty()) { @@ -4225,7 +4225,7 @@ const cmLinkInterfaceLibraries* cmGeneratorTarget::GetLinkInterfaceLibraries( // Link interfaces are not supported for executables that do not // export symbols. - if (this->GetType() == cmState::EXECUTABLE && + if (this->GetType() == cmStateEnums::EXECUTABLE && !this->IsExecutableWithExports()) { return CM_NULLPTR; } @@ -4372,12 +4372,12 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config, if (out != outdir) { conf = ""; } - } else if (this->GetType() == cmState::EXECUTABLE) { + } else if (this->GetType() == cmStateEnums::EXECUTABLE) { // Lookup the output path for executables. out = this->Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"); - } else if (this->GetType() == cmState::STATIC_LIBRARY || - this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::MODULE_LIBRARY) { + } else if (this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::MODULE_LIBRARY) { // Lookup the output path for libraries. out = this->Makefile->GetSafeDefinition("LIBRARY_OUTPUT_PATH"); } @@ -4486,7 +4486,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( // CMP0022 NEW behavior is to use INTERFACE_LINK_LIBRARIES. linkIfaceProp = "INTERFACE_LINK_LIBRARIES"; explicitLibraries = this->GetProperty(linkIfaceProp); - } else if (this->GetType() == cmState::SHARED_LIBRARY || + } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->IsExecutableWithExports()) { // CMP0022 OLD behavior is to use LINK_INTERFACE_LIBRARIES if set on a // shared lib or executable. @@ -4531,8 +4531,9 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries( // There is no implicit link interface for executables or modules // so if none was explicitly set then there is no link interface. - if (!explicitLibraries && (this->GetType() == cmState::EXECUTABLE || - (this->GetType() == cmState::MODULE_LIBRARY))) { + if (!explicitLibraries && + (this->GetType() == cmStateEnums::EXECUTABLE || + (this->GetType() == cmStateEnums::MODULE_LIBRARY))) { return; } iface.Exists = true; @@ -4661,7 +4662,7 @@ cmGeneratorTarget::ImportInfo const* cmGeneratorTarget::GetImportInfo( i = this->ImportInfoMap.insert(entry).first; } - if (this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return &i->second; } // If the location is empty then the target is not available for @@ -4696,7 +4697,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, std::string linkProp = "INTERFACE_LINK_LIBRARIES"; const char* propertyLibs = this->GetProperty(linkProp); - if (this->GetType() != cmState::INTERFACE_LIBRARY) { + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) { if (!propertyLibs) { linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES"; linkProp += suffix; @@ -4713,7 +4714,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, info.Libraries = propertyLibs; } } - if (this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return; } @@ -4734,7 +4735,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, } // Get the soname. - if (this->GetType() == cmState::SHARED_LIBRARY) { + if (this->GetType() == cmStateEnums::SHARED_LIBRARY) { std::string soProp = "IMPORTED_SONAME"; soProp += suffix; if (const char* config_soname = this->GetProperty(soProp)) { @@ -4745,7 +4746,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, } // Get the "no-soname" mark. - if (this->GetType() == cmState::SHARED_LIBRARY) { + if (this->GetType() == cmStateEnums::SHARED_LIBRARY) { std::string soProp = "IMPORTED_NO_SONAME"; soProp += suffix; if (const char* config_no_soname = this->GetProperty(soProp)) { @@ -4759,7 +4760,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, // Get the import library. if (imp) { info.ImportLibrary = imp; - } else if (this->GetType() == cmState::SHARED_LIBRARY || + } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->IsExecutableWithExports()) { std::string impProp = "IMPORTED_IMPLIB"; impProp += suffix; @@ -4795,7 +4796,7 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config, } // Get the cyclic repetition count. - if (this->GetType() == cmState::STATIC_LIBRARY) { + if (this->GetType() == cmStateEnums::STATIC_LIBRARY) { std::string linkProp = "IMPORTED_LINK_INTERFACE_MULTIPLICITY"; linkProp += suffix; if (const char* config_reps = this->GetProperty(linkProp)) { @@ -5191,12 +5192,12 @@ cmGeneratorTarget* cmGeneratorTarget::FindTargetToLink( // Skip targets that will not really be linked. This is probably a // name conflict between an external library and an executable // within the project. - if (tgt && tgt->GetType() == cmState::EXECUTABLE && + if (tgt && tgt->GetType() == cmStateEnums::EXECUTABLE && !tgt->IsExecutableWithExports()) { tgt = CM_NULLPTR; } - if (tgt && tgt->GetType() == cmState::OBJECT_LIBRARY) { + if (tgt && tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) { std::ostringstream e; e << "Target \"" << this->GetName() << "\" links to " "OBJECT library \"" @@ -5242,14 +5243,14 @@ bool cmGeneratorTarget::GetImplibGNUtoMS(std::string const& gnuName, bool cmGeneratorTarget::IsExecutableWithExports() const { - return (this->GetType() == cmState::EXECUTABLE && + return (this->GetType() == cmStateEnums::EXECUTABLE && this->GetPropertyAsBool("ENABLE_EXPORTS")); } bool cmGeneratorTarget::HasImportLibrary() const { return (this->IsDLLPlatform() && - (this->GetType() == cmState::SHARED_LIBRARY || + (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->IsExecutableWithExports())); } @@ -5269,24 +5270,24 @@ std::string cmGeneratorTarget::GetSupportDirectory() const bool cmGeneratorTarget::IsLinkable() const { - return (this->GetType() == cmState::STATIC_LIBRARY || - this->GetType() == cmState::SHARED_LIBRARY || - this->GetType() == cmState::MODULE_LIBRARY || - this->GetType() == cmState::UNKNOWN_LIBRARY || - this->GetType() == cmState::INTERFACE_LIBRARY || + return (this->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GetType() == cmStateEnums::MODULE_LIBRARY || + this->GetType() == cmStateEnums::UNKNOWN_LIBRARY || + this->GetType() == cmStateEnums::INTERFACE_LIBRARY || this->IsExecutableWithExports()); } bool cmGeneratorTarget::IsFrameworkOnApple() const { - return (this->GetType() == cmState::SHARED_LIBRARY && + return (this->GetType() == cmStateEnums::SHARED_LIBRARY && this->Makefile->IsOn("APPLE") && this->GetPropertyAsBool("FRAMEWORK")); } bool cmGeneratorTarget::IsAppBundleOnApple() const { - return (this->GetType() == cmState::EXECUTABLE && + return (this->GetType() == cmStateEnums::EXECUTABLE && this->Makefile->IsOn("APPLE") && this->GetPropertyAsBool("MACOSX_BUNDLE")); } @@ -5298,6 +5299,6 @@ bool cmGeneratorTarget::IsXCTestOnApple() const bool cmGeneratorTarget::IsCFBundleOnApple() const { - return (this->GetType() == cmState::MODULE_LIBRARY && + return (this->GetType() == cmStateEnums::MODULE_LIBRARY && this->Makefile->IsOn("APPLE") && this->GetPropertyAsBool("BUNDLE")); } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 8e5a02d..625c28e 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -60,7 +60,7 @@ public: cmComputeLinkInformation* GetLinkInformation( const std::string& config) const; - cmState::TargetType GetType() const; + cmStateEnums::TargetType GetType() const; const std::string& GetName() const; std::string GetExportName() const; @@ -198,7 +198,7 @@ public: bool LinkLanguagePropagatesToDependents() const { - return this->GetType() == cmState::STATIC_LIBRARY; + return this->GetType() == cmStateEnums::STATIC_LIBRARY; } /** Get the macro to define when building sources in this target. diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx index 3154f8d..ba623d5 100644 --- a/Source/cmGhsMultiTargetGenerator.cxx +++ b/Source/cmGhsMultiTargetGenerator.cxx @@ -130,7 +130,7 @@ void cmGhsMultiTargetGenerator::Generate() this->WriteCompilerFlags(config, language); this->WriteCompilerDefinitions(config, language); this->WriteIncludes(config, language); - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { this->WriteTargetLinkLibraries(config, language); } this->WriteCustomCommands(); @@ -174,7 +174,7 @@ GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag( GhsMultiGpj::Types output; if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(target)) { output = GhsMultiGpj::INTERGRITY_APPLICATION; - } else if (target->GetType() == cmState::STATIC_LIBRARY) { + } else if (target->GetType() == cmStateEnums::STATIC_LIBRARY) { output = GhsMultiGpj::LIBRARY; } else { output = GhsMultiGpj::PROGRAM; @@ -195,13 +195,13 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config, std::string outputDir(this->GetOutputDirectory(config)); std::string outputFilename(this->GetOutputFilename(config)); - if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { std::string const static_library_suffix = this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"); *this->GetFolderBuildStreams() << " -o \"" << outputDir << outputFilename << static_library_suffix << "\"" << std::endl; - } else if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + } else if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { if (notKernel && !this->IsTargetGroup()) { *this->GetFolderBuildStreams() << " -relprog" << std::endl; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 7d0c2da..58c6a00 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1371,14 +1371,14 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() filteredTargets.reserve(targets.size()); for (std::vector::iterator ti = targets.begin(); ti != targets.end(); ++ti) { - if ((*ti)->GetType() == cmState::GLOBAL_TARGET) { + if ((*ti)->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } - if ((*ti)->GetType() != cmState::EXECUTABLE && - (*ti)->GetType() != cmState::STATIC_LIBRARY && - (*ti)->GetType() != cmState::SHARED_LIBRARY && - (*ti)->GetType() != cmState::MODULE_LIBRARY && - (*ti)->GetType() != cmState::OBJECT_LIBRARY) { + if ((*ti)->GetType() != cmStateEnums::EXECUTABLE && + (*ti)->GetType() != cmStateEnums::STATIC_LIBRARY && + (*ti)->GetType() != cmStateEnums::SHARED_LIBRARY && + (*ti)->GetType() != cmStateEnums::MODULE_LIBRARY && + (*ti)->GetType() != cmStateEnums::OBJECT_LIBRARY) { continue; } if ((!(*ti)->GetPropertyAsBool("AUTOMOC") && @@ -1443,13 +1443,13 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() cmTargets& targets = mf->GetTargets(); for (cmTargets::iterator ti = targets.begin(); ti != targets.end(); ++ti) { cmTarget* t = &ti->second; - if (t->GetType() == cmState::GLOBAL_TARGET) { + if (t->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } t->AppendBuildInterfaceIncludes(); - if (t->GetType() == cmState::INTERFACE_LIBRARY) { + if (t->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } @@ -1575,7 +1575,7 @@ void cmGlobalGenerator::CheckTargetProperties() this->Makefiles[i]->ConfigureFinalPass(); cmTargets& targets = this->Makefiles[i]->GetTargets(); for (cmTargets::iterator l = targets.begin(); l != targets.end(); l++) { - if (l->second.GetType() == cmState::INTERFACE_LIBRARY) { + if (l->second.GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } const cmTarget::LinkLibraryVectorType& libs = @@ -1942,7 +1942,7 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const { - if (target->GetType() == cmState::INTERFACE_LIBRARY || + if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY || target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { // This target is excluded from its directory. return true; @@ -2398,8 +2398,8 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(GlobalTargetInfo const& gti, cmMakefile* mf) { // Package - cmTarget target(gti.Name, cmState::GLOBAL_TARGET, cmTarget::VisibilityNormal, - mf); + cmTarget target(gti.Name, cmStateEnums::GLOBAL_TARGET, + cmTarget::VisibilityNormal, mf); target.SetProperty("EXCLUDE_FROM_ALL", "TRUE"); std::vector no_outputs; @@ -2544,7 +2544,7 @@ void cmGlobalGenerator::GetTargetSets(TargetDependSet& projectTargets, bool cmGlobalGenerator::IsRootOnlyTarget(cmGeneratorTarget* target) const { - return (target->GetType() == cmState::GLOBAL_TARGET || + return (target->GetType() == cmStateEnums::GLOBAL_TARGET || target->GetName() == this->GetAllTargetName()); } @@ -2729,7 +2729,7 @@ void cmGlobalGenerator::WriteSummary() this->LocalGenerators[i]->GetGeneratorTargets(); for (std::vector::iterator it = tgts.begin(); it != tgts.end(); ++it) { - if ((*it)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*it)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } this->WriteSummary(*it); diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 57d9aca..1881b7a 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -74,7 +74,7 @@ void cmGlobalKdevelopGenerator::Generate() for (std::vector::const_iterator ti = targets.begin(); ti != targets.end(); ti++) { - if ((*ti)->GetType() == cmState::EXECUTABLE) { + if ((*ti)->GetType() == cmStateEnums::EXECUTABLE) { executable = (*ti)->GetLocation(""); break; } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 67df038..98654c5 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -956,17 +956,17 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs( bool realname = target->IsFrameworkOnApple(); switch (target->GetType()) { - case cmState::EXECUTABLE: - case cmState::SHARED_LIBRARY: - case cmState::STATIC_LIBRARY: - case cmState::MODULE_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: { outputs.push_back(this->ConvertToNinjaPath( target->GetFullPath(configName, false, realname))); break; } - case cmState::OBJECT_LIBRARY: - case cmState::GLOBAL_TARGET: - case cmState::UTILITY: { + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::GLOBAL_TARGET: + case cmStateEnums::UTILITY: { std::string path = target->GetLocalGenerator()->GetCurrentBinaryDirectory() + std::string("/") + target->GetName(); @@ -982,7 +982,7 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs( void cmGlobalNinjaGenerator::AppendTargetDepends( cmGeneratorTarget const* target, cmNinjaDeps& outputs) { - if (target->GetType() == cmState::GLOBAL_TARGET) { + if (target->GetType() == cmStateEnums::GLOBAL_TARGET) { // These depend only on other CMake-provided targets, e.g. "all". std::set const& utils = target->GetUtilities(); for (std::set::const_iterator i = utils.begin(); @@ -997,7 +997,7 @@ void cmGlobalNinjaGenerator::AppendTargetDepends( cmTargetDependSet const& targetDeps = this->GetTargetDirectDepends(target); for (cmTargetDependSet::const_iterator i = targetDeps.begin(); i != targetDeps.end(); ++i) { - if ((*i)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*i)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } this->AppendTargetOutputs(*i, outs); @@ -1034,7 +1034,7 @@ void cmGlobalNinjaGenerator::ComputeTargetDependsClosure( cmTargetDependSet const& targetDeps = this->GetTargetDirectDepends(target); for (cmTargetDependSet::const_iterator i = targetDeps.begin(); i != targetDeps.end(); ++i) { - if ((*i)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*i)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } if (depends.insert(*i).second) { @@ -1102,11 +1102,13 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os) lg->GetGeneratorTargets().begin(); ti != lg->GetGeneratorTargets().end(); ++ti) { cmGeneratorTarget const* gt = *ti; - cmState::TargetType const type = gt->GetType(); - if ((type == cmState::EXECUTABLE || type == cmState::STATIC_LIBRARY || - type == cmState::SHARED_LIBRARY || - type == cmState::MODULE_LIBRARY || - type == cmState::OBJECT_LIBRARY || type == cmState::UTILITY) && + cmStateEnums::TargetType const type = gt->GetType(); + if ((type == cmStateEnums::EXECUTABLE || + type == cmStateEnums::STATIC_LIBRARY || + type == cmStateEnums::SHARED_LIBRARY || + type == cmStateEnums::MODULE_LIBRARY || + type == cmStateEnums::OBJECT_LIBRARY || + type == cmStateEnums::UTILITY) && !gt->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { targetsPerFolder[currentSourceFolder].push_back(gt->GetName()); } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index daacef0..615670c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -382,12 +382,12 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefileLanguageRules( std::vector tgts = lg->GetGeneratorTargets(); for (std::vector::iterator l = tgts.begin(); l != tgts.end(); l++) { - if (((*l)->GetType() == cmState::EXECUTABLE) || - ((*l)->GetType() == cmState::STATIC_LIBRARY) || - ((*l)->GetType() == cmState::SHARED_LIBRARY) || - ((*l)->GetType() == cmState::MODULE_LIBRARY) || - ((*l)->GetType() == cmState::OBJECT_LIBRARY) || - ((*l)->GetType() == cmState::UTILITY)) { + if (((*l)->GetType() == cmStateEnums::EXECUTABLE) || + ((*l)->GetType() == cmStateEnums::STATIC_LIBRARY) || + ((*l)->GetType() == cmStateEnums::SHARED_LIBRARY) || + ((*l)->GetType() == cmStateEnums::MODULE_LIBRARY) || + ((*l)->GetType() == cmStateEnums::OBJECT_LIBRARY) || + ((*l)->GetType() == cmStateEnums::UTILITY)) { cmGeneratorTarget* gt = *l; std::string tname = lg->GetRelativeTargetDirectory(gt); tname += "/DependInfo.cmake"; @@ -416,10 +416,12 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRule2( l != targets.end(); ++l) { cmGeneratorTarget* gtarget = *l; int type = gtarget->GetType(); - if ((type == cmState::EXECUTABLE) || (type == cmState::STATIC_LIBRARY) || - (type == cmState::SHARED_LIBRARY) || - (type == cmState::MODULE_LIBRARY) || - (type == cmState::OBJECT_LIBRARY) || (type == cmState::UTILITY)) { + if ((type == cmStateEnums::EXECUTABLE) || + (type == cmStateEnums::STATIC_LIBRARY) || + (type == cmStateEnums::SHARED_LIBRARY) || + (type == cmStateEnums::MODULE_LIBRARY) || + (type == cmStateEnums::OBJECT_LIBRARY) || + (type == cmStateEnums::UTILITY)) { // Add this to the list of depends rules in this directory. if ((!check_all || !gtarget->GetPropertyAsBool("EXCLUDE_FROM_ALL")) && (!check_relink || @@ -554,11 +556,12 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules( if (!name.empty() && emitted.insert(name).second && // Handle user targets here. Global targets are handled in // the local generator on a per-directory basis. - ((type == cmState::EXECUTABLE) || - (type == cmState::STATIC_LIBRARY) || - (type == cmState::SHARED_LIBRARY) || - (type == cmState::MODULE_LIBRARY) || - (type == cmState::OBJECT_LIBRARY) || (type == cmState::UTILITY))) { + ((type == cmStateEnums::EXECUTABLE) || + (type == cmStateEnums::STATIC_LIBRARY) || + (type == cmStateEnums::SHARED_LIBRARY) || + (type == cmStateEnums::MODULE_LIBRARY) || + (type == cmStateEnums::OBJECT_LIBRARY) || + (type == cmStateEnums::UTILITY))) { // Add a rule to build the target by name. lg->WriteDivider(ruleFileStream); ruleFileStream << "# Target rules for targets named " << name @@ -630,11 +633,12 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( cmGeneratorTarget* gtarget = *t; int type = gtarget->GetType(); std::string name = gtarget->GetName(); - if (!name.empty() && - ((type == cmState::EXECUTABLE) || (type == cmState::STATIC_LIBRARY) || - (type == cmState::SHARED_LIBRARY) || - (type == cmState::MODULE_LIBRARY) || - (type == cmState::OBJECT_LIBRARY) || (type == cmState::UTILITY))) { + if (!name.empty() && ((type == cmStateEnums::EXECUTABLE) || + (type == cmStateEnums::STATIC_LIBRARY) || + (type == cmStateEnums::SHARED_LIBRARY) || + (type == cmStateEnums::MODULE_LIBRARY) || + (type == cmStateEnums::OBJECT_LIBRARY) || + (type == cmStateEnums::UTILITY))) { std::string makefileName; // Add a rule to build the target by name. localName = lg->GetRelativeTargetDirectory(gtarget); @@ -808,7 +812,7 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks() cmLocalGenerator* tlg = gt->GetLocalGenerator(); - if (gt->GetType() == cmState::INTERFACE_LIBRARY || + if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY || gt->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { continue; } @@ -847,7 +851,7 @@ size_t cmGlobalUnixMakefileGenerator3::CountProgressMarksInTarget( TargetDependSet const& depends = this->GetTargetDirectDepends(target); for (TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { - if ((*di)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*di)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } count += this->CountProgressMarksInTarget(*di, emitted); @@ -908,7 +912,7 @@ void cmGlobalUnixMakefileGenerator3::AppendGlobalTargetDepends( i != depends_set.end(); ++i) { // Create the target-level dependency. cmGeneratorTarget const* dep = *i; - if (dep->GetType() == cmState::INTERFACE_LIBRARY) { + if (dep->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } cmLocalUnixMakefileGenerator3* lg3 = @@ -950,13 +954,14 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule( for (std::vector::iterator t = targets.begin(); t != targets.end(); ++t) { cmGeneratorTarget* target = *t; - cmState::TargetType type = target->GetType(); - if ((type == cmState::EXECUTABLE) || - (type == cmState::STATIC_LIBRARY) || - (type == cmState::SHARED_LIBRARY) || - (type == cmState::MODULE_LIBRARY) || - (type == cmState::OBJECT_LIBRARY) || - (type == cmState::GLOBAL_TARGET) || (type == cmState::UTILITY)) { + cmStateEnums::TargetType type = target->GetType(); + if ((type == cmStateEnums::EXECUTABLE) || + (type == cmStateEnums::STATIC_LIBRARY) || + (type == cmStateEnums::SHARED_LIBRARY) || + (type == cmStateEnums::MODULE_LIBRARY) || + (type == cmStateEnums::OBJECT_LIBRARY) || + (type == cmStateEnums::GLOBAL_TARGET) || + (type == cmStateEnums::UTILITY)) { std::string name = target->GetName(); if (emittedTargets.insert(name).second) { path = "... "; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 5d9a02b..f120762 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -230,9 +230,10 @@ cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs() } bool cmGlobalVisualStudio11Generator::NeedsDeploy( - cmState::TargetType type) const + cmStateEnums::TargetType type) const { - if ((type == cmState::EXECUTABLE || type == cmState::SHARED_LIBRARY) && + if ((type == cmStateEnums::EXECUTABLE || + type == cmStateEnums::SHARED_LIBRARY) && (this->SystemIsWindowsPhone || this->SystemIsWindowsStore)) { return true; } diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index 0c03b0a..be78544 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -37,7 +37,7 @@ protected: static std::set GetInstalledWindowsCESDKs(); /** Return true if the configuration needs to be deployed */ - virtual bool NeedsDeploy(cmState::TargetType type) const; + virtual bool NeedsDeploy(cmStateEnums::TargetType type) const; private: class Factory; diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index ffd87e2..6941e15 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -246,7 +246,7 @@ void cmGlobalVisualStudio71Generator::WriteExternalProject( // Write a dsp file into the SLN file, Note, that dependencies from // executables to the libraries it uses are also done here void cmGlobalVisualStudio71Generator::WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmState::TargetType, + std::ostream& fout, const std::string& name, cmStateEnums::TargetType, std::vector const& configs, const std::set& configsPartOfDefaultBuild, std::string const& platformMapping) diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index eb65bcb..9953047 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -56,7 +56,7 @@ protected: const char* path, cmGeneratorTarget const* t); virtual void WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmState::TargetType type, + std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, std::vector const& configs, const std::set& configsPartOfDefaultBuild, const std::string& platformMapping = ""); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 0287def..1ffcf07 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -345,7 +345,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( for (OrderedTargetDependSet::const_iterator tt = projectTargets.begin(); tt != projectTargets.end(); ++tt) { cmGeneratorTarget const* target = *tt; - if (target->GetType() == cmState::INTERFACE_LIBRARY) { + if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } const char* expath = target->GetProperty("EXTERNAL_MSPROJECT"); @@ -377,7 +377,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( for (OrderedTargetDependSet::const_iterator tt = projectTargets.begin(); tt != projectTargets.end(); ++tt) { cmGeneratorTarget const* target = *tt; - if (target->GetType() == cmState::INTERFACE_LIBRARY) { + if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } bool written = false; @@ -446,7 +446,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends( for (OrderedTargetDependSet::const_iterator tt = projectTargets.begin(); tt != projectTargets.end(); ++tt) { cmGeneratorTarget const* target = *tt; - if (target->GetType() == cmState::INTERFACE_LIBRARY) { + if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } const char* vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); @@ -676,7 +676,7 @@ std::set cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( // if it is a utilitiy target then only make it part of the // default build if another target depends on it int type = target->GetType(); - if (type == cmState::GLOBAL_TARGET) { + if (type == cmStateEnums::GLOBAL_TARGET) { // check if INSTALL target is part of default build if (target->GetName() == "INSTALL") { // inspect CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD properties @@ -696,7 +696,7 @@ std::set cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( } return activeConfigs; } - if (type == cmState::UTILITY && + if (type == cmStateEnums::UTILITY && !this->IsDependedOn(projectTargets, target)) { return activeConfigs; } diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 3c6ce11..4d588e6 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -120,7 +120,7 @@ protected: const char* path, cmGeneratorTarget const* t) = 0; virtual void WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmState::TargetType type, + std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, std::vector const& configs, const std::set& configsPartOfDefaultBuild, const std::string& platformMapping = "") = 0; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 2ce0098..64808c9 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -347,7 +347,7 @@ void cmGlobalVisualStudio8Generator::WriteSolutionConfigurations( } void cmGlobalVisualStudio8Generator::WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmState::TargetType type, + std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, std::vector const& configs, const std::set& configsPartOfDefaultBuild, std::string const& platformMapping) @@ -380,10 +380,10 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations( } bool cmGlobalVisualStudio8Generator::NeedsDeploy( - cmState::TargetType type) const + cmStateEnums::TargetType type) const { bool needsDeploy = - (type == cmState::EXECUTABLE || type == cmState::SHARED_LIBRARY); + (type == cmStateEnums::EXECUTABLE || type == cmStateEnums::SHARED_LIBRARY); return this->TargetsWindowsCE() && needsDeploy; } @@ -402,7 +402,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends( OrderedTargetDependSet depends(unordered, std::string()); for (OrderedTargetDependSet::const_iterator i = depends.begin(); i != depends.end(); ++i) { - if ((*i)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*i)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } std::string guid = this->GetGUID((*i)->GetName().c_str()); @@ -419,7 +419,7 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies( ui != target->GetUtilities().end(); ++ui) { if (cmGeneratorTarget* depTarget = target->GetLocalGenerator()->FindGeneratorTargetToUse(ui->c_str())) { - if (depTarget->GetType() != cmState::INTERFACE_LIBRARY && + if (depTarget->GetType() != cmStateEnums::INTERFACE_LIBRARY && depTarget->GetProperty("EXTERNAL_MSPROJECT")) { // This utility dependency names an external .vcproj target. // We use LinkLibraryDependencies="true" to link to it without diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 2543ec1..b149c9d 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -72,14 +72,14 @@ protected: bool AddCheckTarget(); /** Return true if the configuration needs to be deployed */ - virtual bool NeedsDeploy(cmState::TargetType type) const; + virtual bool NeedsDeploy(cmStateEnums::TargetType type) const; static cmIDEFlagTable const* GetExtraFlagTableVS8(); virtual void WriteSLNHeader(std::ostream& fout); virtual void WriteSolutionConfigurations( std::ostream& fout, std::vector const& configs); virtual void WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmState::TargetType type, + std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, std::vector const& configs, const std::set& configsPartOfDefaultBuild, const std::string& platformMapping = ""); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 6296dd2..45f7913 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -81,7 +81,8 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets() for (std::vector::iterator t = targets.begin(); t != targets.end(); ++t) { cmGeneratorTarget* tgt = *t; - if (tgt->GetType() == cmState::GLOBAL_TARGET || tgt->IsImported()) { + if (tgt->GetType() == cmStateEnums::GLOBAL_TARGET || + tgt->IsImported()) { continue; } if (!this->IsExcluded(gen[0], tgt)) { @@ -265,11 +266,11 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target) void cmGlobalVisualStudioGenerator::FollowLinkDepends( const cmGeneratorTarget* target, std::set& linked) { - if (target->GetType() == cmState::INTERFACE_LIBRARY) { + if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return; } if (linked.insert(target).second && - target->GetType() == cmState::STATIC_LIBRARY) { + target->GetType() == cmStateEnums::STATIC_LIBRARY) { // Static library targets do not list their link dependencies so // we must follow them transitively now. TargetDependSet const& depends = this->GetTargetDirectDepends(target); @@ -304,7 +305,7 @@ bool cmGlobalVisualStudioGenerator::ComputeTargetDepends() static bool VSLinkable(cmGeneratorTarget const* t) { - return t->IsLinkable() || t->GetType() == cmState::OBJECT_LIBRARY; + return t->IsLinkable() || t->GetType() == cmStateEnums::OBJECT_LIBRARY; } void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( @@ -333,10 +334,10 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( // leaving them out for the static library itself but following them // transitively for other targets. - bool allowLinkable = (target->GetType() != cmState::STATIC_LIBRARY && - target->GetType() != cmState::SHARED_LIBRARY && - target->GetType() != cmState::MODULE_LIBRARY && - target->GetType() != cmState::EXECUTABLE); + bool allowLinkable = (target->GetType() != cmStateEnums::STATIC_LIBRARY && + target->GetType() != cmStateEnums::SHARED_LIBRARY && + target->GetType() != cmStateEnums::MODULE_LIBRARY && + target->GetType() != cmStateEnums::EXECUTABLE); TargetDependSet const& depends = this->GetTargetDirectDepends(target); @@ -344,7 +345,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( // Static libraries cannot depend on their link implementation // due to behavior (2), but they do not really need to. std::set linkDepends; - if (target->GetType() != cmState::STATIC_LIBRARY) { + if (target->GetType() != cmStateEnums::STATIC_LIBRARY) { for (TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { cmTargetDepend dep = *di; @@ -367,7 +368,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( // Collect all targets linked by this target so we can avoid // intermediate targets below. TargetSet linked; - if (target->GetType() != cmState::STATIC_LIBRARY) { + if (target->GetType() != cmStateEnums::STATIC_LIBRARY) { linked = this->GetTargetLinkClosure(target); } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 7b1afa5..34a01d6 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -444,7 +444,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( l != tgts.end(); l++) { cmGeneratorTarget* target = *l; - if (target->GetType() == cmState::GLOBAL_TARGET) { + if (target->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } @@ -459,12 +459,12 @@ void cmGlobalXCodeGenerator::AddExtraTargets( // this will make sure that when the next target is built // things are up-to-date if (!makeHelper.empty() && - (target->GetType() == cmState::EXECUTABLE || + (target->GetType() == cmStateEnums::EXECUTABLE || // Nope - no post-build for OBJECT_LIRBRARY - // target->GetType() == cmState::OBJECT_LIBRARY || - target->GetType() == cmState::STATIC_LIBRARY || - target->GetType() == cmState::SHARED_LIBRARY || - target->GetType() == cmState::MODULE_LIBRARY)) { + // target->GetType() == cmStateEnums::OBJECT_LIBRARY || + target->GetType() == cmStateEnums::STATIC_LIBRARY || + target->GetType() == cmStateEnums::SHARED_LIBRARY || + target->GetType() == cmStateEnums::MODULE_LIBRARY)) { makeHelper[makeHelper.size() - 1] = // fill placeholder this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)"); cmCustomCommandLines commandLines; @@ -475,7 +475,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets( cmTarget::POST_BUILD, "Depend check for xcode", dir.c_str()); } - if (target->GetType() != cmState::INTERFACE_LIBRARY && + if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY && !target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { allbuild->AddUtility(target->GetName()); } @@ -955,12 +955,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( continue; } - if (gtgt->GetType() == cmState::INTERFACE_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } - if (gtgt->GetType() == cmState::UTILITY || - gtgt->GetType() == cmState::GLOBAL_TARGET) { + if (gtgt->GetType() == cmStateEnums::UTILITY || + gtgt->GetType() == cmStateEnums::GLOBAL_TARGET) { cmXCodeObject* t = this->CreateUtilityTarget(gtgt); if (!t) { return false; @@ -1188,9 +1188,9 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguages() void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt) { // This matters only for targets that link. - if (gtgt->GetType() != cmState::EXECUTABLE && - gtgt->GetType() != cmState::SHARED_LIBRARY && - gtgt->GetType() != cmState::MODULE_LIBRARY) { + if (gtgt->GetType() != cmStateEnums::EXECUTABLE && + gtgt->GetType() != cmStateEnums::SHARED_LIBRARY && + gtgt->GetType() != cmStateEnums::MODULE_LIBRARY) { return; } @@ -1268,7 +1268,7 @@ void cmGlobalXCodeGenerator::CreateCustomCommands( std::vector const& prelink = gtgt->GetPreLinkCommands(); std::vector postbuild = gtgt->GetPostBuildCommands(); - if (gtgt->GetType() == cmState::SHARED_LIBRARY && + if (gtgt->GetType() == cmStateEnums::SHARED_LIBRARY && !gtgt->IsFrameworkOnApple()) { cmCustomCommandLines cmd; cmd.resize(1); @@ -1590,16 +1590,16 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, cmXCodeObject* buildSettings, const std::string& configName) { - if (gtgt->GetType() == cmState::INTERFACE_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return; } std::string defFlags; - bool shared = ((gtgt->GetType() == cmState::SHARED_LIBRARY) || - (gtgt->GetType() == cmState::MODULE_LIBRARY)); - bool binary = ((gtgt->GetType() == cmState::OBJECT_LIBRARY) || - (gtgt->GetType() == cmState::STATIC_LIBRARY) || - (gtgt->GetType() == cmState::EXECUTABLE) || shared); + bool shared = ((gtgt->GetType() == cmStateEnums::SHARED_LIBRARY) || + (gtgt->GetType() == cmStateEnums::MODULE_LIBRARY)); + bool binary = ((gtgt->GetType() == cmStateEnums::OBJECT_LIBRARY) || + (gtgt->GetType() == cmStateEnums::STATIC_LIBRARY) || + (gtgt->GetType() == cmStateEnums::EXECUTABLE) || shared); // Compute the compilation flags for each language. std::set languages; @@ -1653,11 +1653,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, std::string extraLinkOptionsVar; std::string extraLinkOptions; - if (gtgt->GetType() == cmState::EXECUTABLE) { + if (gtgt->GetType() == cmStateEnums::EXECUTABLE) { extraLinkOptionsVar = "CMAKE_EXE_LINKER_FLAGS"; - } else if (gtgt->GetType() == cmState::SHARED_LIBRARY) { + } else if (gtgt->GetType() == cmStateEnums::SHARED_LIBRARY) { extraLinkOptionsVar = "CMAKE_SHARED_LINKER_FLAGS"; - } else if (gtgt->GetType() == cmState::MODULE_LIBRARY) { + } else if (gtgt->GetType() == cmStateEnums::MODULE_LIBRARY) { extraLinkOptionsVar = "CMAKE_MODULE_LINKER_FLAGS"; } if (!extraLinkOptionsVar.empty()) { @@ -1665,8 +1665,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, extraLinkOptions, extraLinkOptionsVar, configName); } - if (gtgt->GetType() == cmState::OBJECT_LIBRARY || - gtgt->GetType() == cmState::STATIC_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::OBJECT_LIBRARY || + gtgt->GetType() == cmStateEnums::STATIC_LIBRARY) { this->CurrentLocalGenerator->GetStaticLibraryFlags( extraLinkOptions, cmSystemTools::UpperCase(configName), gtgt); } else { @@ -1736,10 +1736,10 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, // Set attributes to specify the proper name for the target. std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory(); - if (gtgt->GetType() == cmState::STATIC_LIBRARY || - gtgt->GetType() == cmState::SHARED_LIBRARY || - gtgt->GetType() == cmState::MODULE_LIBRARY || - gtgt->GetType() == cmState::EXECUTABLE) { + if (gtgt->GetType() == cmStateEnums::STATIC_LIBRARY || + gtgt->GetType() == cmStateEnums::SHARED_LIBRARY || + gtgt->GetType() == cmStateEnums::MODULE_LIBRARY || + gtgt->GetType() == cmStateEnums::EXECUTABLE) { if (this->XcodeVersion >= 21) { if (!gtgt->UsesDefaultOutputDir(configName, false)) { std::string pncdir = gtgt->GetDirectory(configName); @@ -1759,7 +1759,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, this->CreateString(pnprefix)); buildSettings->AddAttribute("EXECUTABLE_SUFFIX", this->CreateString(pnsuffix)); - } else if (gtgt->GetType() == cmState::OBJECT_LIBRARY) { + } else if (gtgt->GetType() == cmStateEnums::OBJECT_LIBRARY) { pnprefix = "lib"; pnbase = gtgt->GetName(); pnsuffix = ".a"; @@ -1782,14 +1782,14 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, // Handle settings for each target type. switch (gtgt->GetType()) { - case cmState::OBJECT_LIBRARY: - case cmState::STATIC_LIBRARY: { + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: { buildSettings->AddAttribute("LIBRARY_STYLE", this->CreateString("STATIC")); break; } - case cmState::MODULE_LIBRARY: { + case cmStateEnums::MODULE_LIBRARY: { buildSettings->AddAttribute("LIBRARY_STYLE", this->CreateString("BUNDLE")); if (gtgt->IsCFBundleOnApple()) { @@ -1839,7 +1839,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, } break; } - case cmState::SHARED_LIBRARY: { + case cmStateEnums::SHARED_LIBRARY: { if (gtgt->GetPropertyAsBool("FRAMEWORK")) { std::string fw_version = gtgt->GetFrameworkVersion(); buildSettings->AddAttribute("FRAMEWORK_VERSION", @@ -1872,7 +1872,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, this->CreateString("DYNAMIC")); break; } - case cmState::EXECUTABLE: { + case cmStateEnums::EXECUTABLE: { // Add the flags to create an executable. std::string createFlags = this->LookupFlags("CMAKE_", llang, "_LINK_FLAGS", ""); @@ -2051,7 +2051,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, // Create the INSTALL_PATH attribute. std::string install_name_dir; - if (gtgt->GetType() == cmState::SHARED_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::SHARED_LIBRARY) { // Get the install_name directory for the build tree. install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName); // Xcode doesn't create the correct install_name in some cases. @@ -2124,7 +2124,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, } // Runtime version information. - if (gtgt->GetType() == cmState::SHARED_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::SHARED_LIBRARY) { int major; int minor; int patch; @@ -2219,7 +2219,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget( this->XCodeObjectMap[gtgt] = target; // Add source files without build rules for editing convenience. - if (gtgt->GetType() == cmState::UTILITY) { + if (gtgt->GetType() == cmStateEnums::UTILITY) { std::vector sources; if (!gtgt->GetConfigCommonSourceFiles(sources)) { return 0; @@ -2285,8 +2285,8 @@ const char* cmGlobalXCodeGenerator::GetTargetLinkFlagsVar( cmGeneratorTarget const* target) const { if (this->XcodeVersion >= 60 && - (target->GetType() == cmState::STATIC_LIBRARY || - target->GetType() == cmState::OBJECT_LIBRARY)) { + (target->GetType() == cmStateEnums::STATIC_LIBRARY || + target->GetType() == cmStateEnums::OBJECT_LIBRARY)) { return "OTHER_LIBTOOLFLAGS"; } else { return "OTHER_LDFLAGS"; @@ -2297,10 +2297,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType( cmGeneratorTarget* target) { switch (target->GetType()) { - case cmState::OBJECT_LIBRARY: - case cmState::STATIC_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return "archive.ar"; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: if (target->IsXCTestOnApple()) return "wrapper.cfbundle"; else if (target->IsCFBundleOnApple()) @@ -2308,11 +2308,11 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType( else return ((this->XcodeVersion >= 22) ? "compiled.mach-o.executable" : "compiled.mach-o.dylib"); - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return (target->GetPropertyAsBool("FRAMEWORK") ? "wrapper.framework" : "compiled.mach-o.dylib"); - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return "compiled.mach-o.executable"; default: break; @@ -2324,10 +2324,10 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType( cmGeneratorTarget* target) { switch (target->GetType()) { - case cmState::OBJECT_LIBRARY: - case cmState::STATIC_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return "com.apple.product-type.library.static"; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: if (target->IsXCTestOnApple()) return "com.apple.product-type.bundle.unit-test"; else if (target->IsCFBundleOnApple()) @@ -2336,11 +2336,11 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType( return ((this->XcodeVersion >= 22) ? "com.apple.product-type.tool" : "com.apple.product-type.library.dynamic"); - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return (target->GetPropertyAsBool("FRAMEWORK") ? "com.apple.product-type.framework" : "com.apple.product-type.library.dynamic"); - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return (target->GetPropertyAsBool("MACOSX_BUNDLE") ? "com.apple.product-type.application" : "com.apple.product-type.tool"); @@ -2353,7 +2353,7 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType( cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget( cmGeneratorTarget* gtgt, cmXCodeObject* buildPhases) { - if (gtgt->GetType() == cmState::INTERFACE_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return 0; } cmXCodeObject* target = this->CreateObject(cmXCodeObject::PBXNativeTarget); @@ -2380,7 +2380,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget( fileRef->AddAttribute("explicitFileType", this->CreateString(fileType)); } std::string fullName; - if (gtgt->GetType() == cmState::OBJECT_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::OBJECT_LIBRARY) { fullName = "lib"; fullName += gtgt->GetName(); fullName += ".a"; @@ -2527,7 +2527,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) cmSystemTools::Error("Error no target on xobject\n"); return; } - if (gt->GetType() == cmState::INTERFACE_LIBRARY) { + if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return; } @@ -2564,8 +2564,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) } // Skip link information for object libraries. - if (gt->GetType() == cmState::OBJECT_LIBRARY || - gt->GetType() == cmState::STATIC_LIBRARY) { + if (gt->GetType() == cmStateEnums::OBJECT_LIBRARY || + gt->GetType() == cmStateEnums::STATIC_LIBRARY) { continue; } @@ -2620,7 +2620,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) if (li->IsPath) { linkLibs += this->XCodeEscapePath(li->Value); } else if (!li->Target || - li->Target->GetType() != cmState::INTERFACE_LIBRARY) { + li->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { linkLibs += li->Value; } if (li->Target && !li->Target->IsImported()) { @@ -2649,10 +2649,10 @@ bool cmGlobalXCodeGenerator::CreateGroups( // end up with (empty anyhow) ALL_BUILD and XCODE_DEPEND_HELPER source // groups: // - if (gtgt->GetType() == cmState::GLOBAL_TARGET) { + if (gtgt->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } - if (gtgt->GetType() == cmState::INTERFACE_LIBRARY) { + if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } @@ -3149,20 +3149,20 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( cmXCodeObject* target = *i; cmGeneratorTarget* gt = target->GetTarget(); - if (gt->GetType() == cmState::EXECUTABLE || + if (gt->GetType() == cmStateEnums::EXECUTABLE || // Nope - no post-build for OBJECT_LIRBRARY - // gt->GetType() == cmState::OBJECT_LIBRARY || - gt->GetType() == cmState::STATIC_LIBRARY || - gt->GetType() == cmState::SHARED_LIBRARY || - gt->GetType() == cmState::MODULE_LIBRARY) { + // gt->GetType() == cmStateEnums::OBJECT_LIBRARY || + gt->GetType() == cmStateEnums::STATIC_LIBRARY || + gt->GetType() == cmStateEnums::SHARED_LIBRARY || + gt->GetType() == cmStateEnums::MODULE_LIBRARY) { // Declare an entry point for the target post-build phase. makefileStream << this->PostBuildMakeTarget(gt->GetName(), *ct) << ":\n"; } - if (gt->GetType() == cmState::EXECUTABLE || - gt->GetType() == cmState::SHARED_LIBRARY || - gt->GetType() == cmState::MODULE_LIBRARY) { + if (gt->GetType() == cmStateEnums::EXECUTABLE || + gt->GetType() == cmStateEnums::SHARED_LIBRARY || + gt->GetType() == cmStateEnums::MODULE_LIBRARY) { std::string tfull = gt->GetFullPath(configName); std::string trel = this->ConvertToRelativeForMake(tfull.c_str()); diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index db11bd3..6b32f73 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -24,13 +24,13 @@ static const char* getShapeForTarget(const cmGeneratorTarget* target) } switch (target->GetType()) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return "house"; - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return "diamond"; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return "polygon"; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: return "octagon"; default: break; @@ -495,16 +495,16 @@ bool cmGraphVizWriter::IgnoreThisTarget(const std::string& name) } bool cmGraphVizWriter::GenerateForTargetType( - cmState::TargetType targetType) const + cmStateEnums::TargetType targetType) const { switch (targetType) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return this->GenerateForExecutables; - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return this->GenerateForStaticLibs; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return this->GenerateForSharedLibs; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: return this->GenerateForModuleLibs; default: break; diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h index 0efe2b7..8d5515b 100644 --- a/Source/cmGraphVizWriter.h +++ b/Source/cmGraphVizWriter.h @@ -60,7 +60,7 @@ protected: bool IgnoreThisTarget(const std::string& name); - bool GenerateForTargetType(cmState::TargetType targetType) const; + bool GenerateForTargetType(cmStateEnums::TargetType targetType) const; std::string GraphType; std::string GraphName; diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index 166bc7c..57bf33e 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -70,8 +70,8 @@ bool cmIncludeExternalMSProjectCommand::InitialPass( } // Create a target instance for this utility. - cmTarget* target = - this->Makefile->AddNewTarget(cmState::UTILITY, utility_name.c_str()); + cmTarget* target = this->Makefile->AddNewTarget(cmStateEnums::UTILITY, + utility_name.c_str()); target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str()); target->SetProperty("EXTERNAL_MSPROJECT", path.c_str()); diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index f040a4e..d85748e 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -327,19 +327,19 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if (cmTarget* target = this->Makefile->FindLocalNonAliasTarget(*targetIt)) { // Found the target. Check its type. - if (target->GetType() != cmState::EXECUTABLE && - target->GetType() != cmState::STATIC_LIBRARY && - target->GetType() != cmState::SHARED_LIBRARY && - target->GetType() != cmState::MODULE_LIBRARY && - target->GetType() != cmState::OBJECT_LIBRARY && - target->GetType() != cmState::INTERFACE_LIBRARY) { + if (target->GetType() != cmStateEnums::EXECUTABLE && + target->GetType() != cmStateEnums::STATIC_LIBRARY && + target->GetType() != cmStateEnums::SHARED_LIBRARY && + target->GetType() != cmStateEnums::MODULE_LIBRARY && + target->GetType() != cmStateEnums::OBJECT_LIBRARY && + target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which is not an executable, library, or module."; this->SetError(e.str()); return false; } - if (target->GetType() == cmState::OBJECT_LIBRARY) { + if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { std::ostringstream e; e << "TARGETS given OBJECT library \"" << (*targetIt) << "\" which may not be installed."; @@ -387,7 +387,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) bool namelinkOnly = false; switch (target.GetType()) { - case cmState::SHARED_LIBRARY: { + case cmStateEnums::SHARED_LIBRARY: { // Shared libraries are handled differently on DLL and non-DLL // platforms. All windows platforms are DLL platforms including // cygwin. Currently no other platform is a DLL platform. @@ -454,7 +454,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } } } break; - case cmState::STATIC_LIBRARY: { + case cmStateEnums::STATIC_LIBRARY: { // Static libraries use ARCHIVE properties. if (!archiveArgs.GetDestination().empty()) { archiveGenerator = @@ -468,7 +468,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) return false; } } break; - case cmState::MODULE_LIBRARY: { + case cmStateEnums::MODULE_LIBRARY: { // Modules use LIBRARY properties. if (!libraryArgs.GetDestination().empty()) { libraryGenerator = @@ -484,7 +484,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) return false; } } break; - case cmState::EXECUTABLE: { + case cmStateEnums::EXECUTABLE: { if (target.IsAppBundleOnApple()) { // Application bundles use the BUNDLE properties. if (!bundleArgs.GetDestination().empty()) { @@ -534,7 +534,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) CreateInstallTargetGenerator(target, archiveArgs, true, true); } } break; - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: // Nothing to do. An INTERFACE_LIBRARY can be installed, but the // only effect of that is to make it exportable. It installs no // other files itself. @@ -553,7 +553,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) bool createInstallGeneratorsForTargetFileSets = true; if (target.IsFrameworkOnApple() || - target.GetType() == cmState::INTERFACE_LIBRARY) { + target.GetType() == cmStateEnums::INTERFACE_LIBRARY) { createInstallGeneratorsForTargetFileSets = false; } diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 70ae204..ed3be3f 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -80,36 +80,36 @@ void cmInstallTargetGenerator::GenerateScriptForConfig( std::vector filesFrom; std::vector filesTo; std::string literal_args; - cmState::TargetType targetType = this->Target->GetType(); + cmStateEnums::TargetType targetType = this->Target->GetType(); cmInstallType type = cmInstallType(); switch (targetType) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: type = cmInstallType_EXECUTABLE; break; - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: type = cmInstallType_STATIC_LIBRARY; break; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: type = cmInstallType_SHARED_LIBRARY; break; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: type = cmInstallType_MODULE_LIBRARY; break; - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: // Not reachable. We never create a cmInstallTargetGenerator for // an INTERFACE_LIBRARY. assert(0 && "INTERFACE_LIBRARY targets have no installable outputs."); break; - case cmState::OBJECT_LIBRARY: - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: - case cmState::UNKNOWN_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: + case cmStateEnums::UNKNOWN_LIBRARY: this->Target->GetLocalGenerator()->IssueMessage( cmake::INTERNAL_ERROR, "cmInstallTargetGenerator created with non-installable target."); return; } - if (targetType == cmState::EXECUTABLE) { + if (targetType == cmStateEnums::EXECUTABLE) { // There is a bug in cmInstallCommand if this fails. assert(this->NamelinkMode == NamelinkModeNone); @@ -337,7 +337,7 @@ std::string cmInstallTargetGenerator::GetInstallFilename( { std::string fname; // Compute the name of the library. - if (target->GetType() == cmState::EXECUTABLE) { + if (target->GetType() == cmStateEnums::EXECUTABLE) { std::string targetName; std::string targetNameReal; std::string targetNameImport; @@ -471,9 +471,9 @@ void cmInstallTargetGenerator::AddInstallNamePatchRule( std::string const& toDestDirPath) { if (this->ImportLibrary || - !(this->Target->GetType() == cmState::SHARED_LIBRARY || - this->Target->GetType() == cmState::MODULE_LIBRARY || - this->Target->GetType() == cmState::EXECUTABLE)) { + !(this->Target->GetType() == cmStateEnums::SHARED_LIBRARY || + this->Target->GetType() == cmStateEnums::MODULE_LIBRARY || + this->Target->GetType() == cmStateEnums::EXECUTABLE)) { return; } @@ -527,7 +527,7 @@ void cmInstallTargetGenerator::AddInstallNamePatchRule( // Edit the install_name of the target itself if necessary. std::string new_id; - if (this->Target->GetType() == cmState::SHARED_LIBRARY) { + if (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY) { std::string for_build = this->Target->GetInstallNameDirForBuildTree(config); std::string for_install = this->Target->GetInstallNameDirForInstallTree(); @@ -704,7 +704,7 @@ void cmInstallTargetGenerator::AddStripRule(std::ostream& os, // don't strip static and import libraries, because it removes the only // symbol table they have so you can't link to them anymore - if (this->Target->GetType() == cmState::STATIC_LIBRARY || + if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY || this->ImportLibrary) { return; } @@ -731,7 +731,7 @@ void cmInstallTargetGenerator::AddRanlibRule(std::ostream& os, const std::string& toDestDirPath) { // Static libraries need ranlib on this platform. - if (this->Target->GetType() != cmState::STATIC_LIBRARY) { + if (this->Target->GetType() != cmStateEnums::STATIC_LIBRARY) { return; } @@ -767,10 +767,10 @@ void cmInstallTargetGenerator::AddUniversalInstallRule( } switch (this->Target->GetType()) { - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: break; default: diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index 24f3578..5fc861b 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -55,7 +55,8 @@ std::string cmLinkLineComputer::ComputeLinkLibs(cmComputeLinkInformation& cli) ItemVector const& items = cli.GetItems(); for (ItemVector::const_iterator li = items.begin(); li != items.end(); ++li) { - if (li->Target && li->Target->GetType() == cmState::INTERFACE_LIBRARY) { + if (li->Target && + li->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } if (li->IsPath) { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1c3a97d..b6fb3e6 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -199,7 +199,7 @@ void cmLocalGenerator::TraceDependencies() std::vector targets = this->GetGeneratorTargets(); for (std::vector::iterator t = targets.begin(); t != targets.end(); ++t) { - if ((*t)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*t)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } (*t)->TraceDependencies(); @@ -542,7 +542,7 @@ void cmLocalGenerator::ComputeTargetManifest() for (std::vector::iterator t = targets.begin(); t != targets.end(); ++t) { cmGeneratorTarget* target = *t; - if (target->GetType() == cmState::INTERFACE_LIBRARY) { + if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } for (std::vector::iterator ci = configNames.begin(); @@ -911,12 +911,12 @@ void cmLocalGenerator::GetTargetFlags( "CMAKE_SHARED_LINKER_FLAGS"; // default to shared library switch (target->GetType()) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: this->GetStaticLibraryFlags(linkFlags, buildType, target); break; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS"; - case cmState::SHARED_LIBRARY: { + case cmStateEnums::SHARED_LIBRARY: { linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable); linkFlags += " "; if (!buildType.empty()) { @@ -962,7 +962,7 @@ void cmLocalGenerator::GetTargetFlags( frameworkPath, linkPath); } } break; - case cmState::EXECUTABLE: { + case cmStateEnums::EXECUTABLE: { linkFlags += this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS"); linkFlags += " "; if (!buildType.empty()) { @@ -1189,7 +1189,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065( std::string linkFlags; // Flags to link an executable to shared libraries. - if (tgt.GetType() == cmState::EXECUTABLE && + if (tgt.GetType() == cmStateEnums::EXECUTABLE && this->StateSnapshot.GetState()->GetGlobalPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS")) { bool add_shlib_flags = false; @@ -1334,8 +1334,8 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName, // found is part of the inName if (cmSystemTools::FileIsFullPath(inName.c_str())) { std::string tLocation; - if (target->GetType() >= cmState::EXECUTABLE && - target->GetType() <= cmState::MODULE_LIBRARY) { + if (target->GetType() >= cmStateEnums::EXECUTABLE && + target->GetType() <= cmStateEnums::MODULE_LIBRARY) { tLocation = target->GetLocation(config); tLocation = cmSystemTools::GetFilenamePath(tLocation); tLocation = cmSystemTools::CollapseFullPath(tLocation); @@ -1352,23 +1352,23 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName, } } switch (target->GetType()) { - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::UNKNOWN_LIBRARY: + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::UNKNOWN_LIBRARY: dep = target->GetLocation(config); return true; - case cmState::OBJECT_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: // An object library has no single file on which to depend. // This was listed to get the target-level dependency. return false; - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: // An interface library has no file on which to depend. // This was listed to get the target-level dependency. return false; - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: // A utility target has no file on which to depend. This was listed // only to get the target-level dependency. return false; @@ -1584,8 +1584,8 @@ void cmLocalGenerator::AddVisibilityPresetFlags( std::string warnCMP0063; std::string* pWarnCMP0063 = CM_NULLPTR; - if (target->GetType() != cmState::SHARED_LIBRARY && - target->GetType() != cmState::MODULE_LIBRARY && + if (target->GetType() != cmStateEnums::SHARED_LIBRARY && + target->GetType() != cmStateEnums::MODULE_LIBRARY && !target->IsExecutableWithExports()) { switch (target->GetPolicyStatusCMP0063()) { case cmPolicies::OLD: @@ -1627,13 +1627,13 @@ void cmLocalGenerator::AddCMP0018Flags(std::string& flags, { int targetType = target->GetType(); - bool shared = ((targetType == cmState::SHARED_LIBRARY) || - (targetType == cmState::MODULE_LIBRARY)); + bool shared = ((targetType == cmStateEnums::SHARED_LIBRARY) || + (targetType == cmStateEnums::MODULE_LIBRARY)); if (this->GetShouldUseOldFlags(shared, lang)) { this->AddSharedFlags(flags, lang, shared); } else { - if (target->GetType() == cmState::OBJECT_LIBRARY) { + if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) { if (target->GetPropertyAsBool("POSITION_INDEPENDENT_CODE")) { this->AddPositionIndependentFlags(flags, lang, targetType); } @@ -1696,7 +1696,7 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags, { const char* picFlags = CM_NULLPTR; - if (targetType == cmState::EXECUTABLE) { + if (targetType == cmStateEnums::EXECUTABLE) { std::string flagsVar = "CMAKE_"; flagsVar += lang; flagsVar += "_COMPILE_OPTIONS_PIE"; @@ -1933,7 +1933,7 @@ void cmLocalGenerator::GenerateTargetInstallRules( std::vector tgts = this->GetGeneratorTargets(); for (std::vector::iterator l = tgts.begin(); l != tgts.end(); ++l) { - if ((*l)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } @@ -1956,15 +1956,15 @@ void cmLocalGenerator::GenerateTargetInstallRules( // Generate the proper install generator for this target type. switch ((*l)->GetType()) { - case cmState::EXECUTABLE: - case cmState::STATIC_LIBRARY: - case cmState::MODULE_LIBRARY: { + case cmStateEnums::EXECUTABLE: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: { // Use a target install generator. cmInstallTargetGeneratorLocal g(this, (*l)->GetName(), destination.c_str(), false); g.Generate(os, config, configurationTypes); } break; - case cmState::SHARED_LIBRARY: { + case cmStateEnums::SHARED_LIBRARY: { #if defined(_WIN32) || defined(__CYGWIN__) // Special code to handle DLL. Install the import library // to the normal destination and the DLL to the runtime diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx index 157b32e..5f37af5 100644 --- a/Source/cmLocalGhsMultiGenerator.cxx +++ b/Source/cmLocalGhsMultiGenerator.cxx @@ -24,7 +24,7 @@ void cmLocalGhsMultiGenerator::Generate() for (std::vector::iterator l = tgts.begin(); l != tgts.end(); ++l) { - if ((*l)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } cmGhsMultiTargetGenerator tg(*l); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 1863376..232e1dc 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -81,7 +81,7 @@ void cmLocalNinjaGenerator::Generate() std::vector targets = this->GetGeneratorTargets(); for (std::vector::iterator t = targets.begin(); t != targets.end(); ++t) { - if ((*t)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*t)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } cmNinjaTargetGenerator* tg = cmNinjaTargetGenerator::New(*t); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index f30414c..5b90f99 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -120,7 +120,7 @@ void cmLocalUnixMakefileGenerator3::Generate() static_cast(this->GlobalGenerator); for (std::vector::iterator t = targets.begin(); t != targets.end(); ++t) { - if ((*t)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*t)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } CM_AUTO_PTR tg( @@ -172,7 +172,7 @@ void cmLocalUnixMakefileGenerator3::GetLocalObjectFiles( for (std::vector::iterator ti = targets.begin(); ti != targets.end(); ++ti) { cmGeneratorTarget* gt = *ti; - if (gt->GetType() == cmState::INTERFACE_LIBRARY) { + if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } std::vector objectSources; @@ -382,12 +382,12 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets( std::string localName; for (std::vector::iterator t = targets.begin(); t != targets.end(); ++t) { - if (((*t)->GetType() == cmState::EXECUTABLE) || - ((*t)->GetType() == cmState::STATIC_LIBRARY) || - ((*t)->GetType() == cmState::SHARED_LIBRARY) || - ((*t)->GetType() == cmState::MODULE_LIBRARY) || - ((*t)->GetType() == cmState::OBJECT_LIBRARY) || - ((*t)->GetType() == cmState::UTILITY)) { + if (((*t)->GetType() == cmStateEnums::EXECUTABLE) || + ((*t)->GetType() == cmStateEnums::STATIC_LIBRARY) || + ((*t)->GetType() == cmStateEnums::SHARED_LIBRARY) || + ((*t)->GetType() == cmStateEnums::MODULE_LIBRARY) || + ((*t)->GetType() == cmStateEnums::OBJECT_LIBRARY) || + ((*t)->GetType() == cmStateEnums::UTILITY)) { emitted.insert((*t)->GetName()); // for subdirs add a rule to build this specific target by name. @@ -1558,7 +1558,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( std::vector targets = this->GetGeneratorTargets(); std::vector::iterator glIt; for (glIt = targets.begin(); glIt != targets.end(); ++glIt) { - if ((*glIt)->GetType() == cmState::GLOBAL_TARGET) { + if ((*glIt)->GetType() == cmStateEnums::GLOBAL_TARGET) { std::string targetString = "Special rule for the target " + (*glIt)->GetName(); std::vector commands; diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 6f9f009..006cdf8 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -63,7 +63,7 @@ void cmLocalVisualStudio10Generator::Generate() std::vector tgts = this->GetGeneratorTargets(); for (std::vector::iterator l = tgts.begin(); l != tgts.end(); ++l) { - if ((*l)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } if (static_cast(this->GlobalGenerator) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index a4b28b5..1ea56b4 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -64,7 +64,7 @@ void cmLocalVisualStudio7Generator::AddHelperCommands() std::vector tgts = this->GetGeneratorTargets(); for (std::vector::iterator l = tgts.begin(); l != tgts.end(); ++l) { - if ((*l)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } const char* path = (*l)->GetProperty("EXTERNAL_MSPROJECT"); @@ -93,7 +93,7 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules() std::vector tgts = this->GetGeneratorTargets(); for (std::vector::iterator l = tgts.begin(); l != tgts.end(); ++l) { - if ((*l)->GetType() == cmState::GLOBAL_TARGET) { + if ((*l)->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } if ((*l)->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) { @@ -112,7 +112,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() std::vector tgts = this->GetGeneratorTargets(); for (std::vector::iterator l = tgts.begin(); l != tgts.end(); l++) { - if ((*l)->GetType() == cmState::GLOBAL_TARGET) { + if ((*l)->GetType() == cmStateEnums::GLOBAL_TARGET) { std::vector no_depends; cmCustomCommandLine force_command; force_command.push_back("cd"); @@ -154,7 +154,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles() // Create the project file for each target. for (std::vector::iterator l = tgts.begin(); l != tgts.end(); l++) { - if ((*l)->GetType() == cmState::INTERFACE_LIBRARY) { + if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace @@ -615,22 +615,22 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( bool targetBuilds = true; switch (target->GetType()) { - case cmState::OBJECT_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: targetBuilds = false; // no manifest tool for object library - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: projectType = "typeStaticLibrary"; configType = "4"; break; - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: projectType = "typeDynamicLibrary"; configType = "2"; break; - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: configType = "1"; break; - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: configType = "10"; default: targetBuilds = false; @@ -725,8 +725,9 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( intermediateDir += "/"; intermediateDir += configName; - if (target->GetType() < cmState::UTILITY) { - std::string const& outDir = target->GetType() == cmState::OBJECT_LIBRARY + if (target->GetType() < cmStateEnums::UTILITY) { + std::string const& outDir = + target->GetType() == cmStateEnums::OBJECT_LIBRARY ? intermediateDir : target->GetDirectory(configName); /* clang-format off */ @@ -810,7 +811,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( targetOptions.OutputFlagMap(fout, "\t\t\t\t"); targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX"); fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n"; - if (target->GetType() <= cmState::OBJECT_LIBRARY) { + if (target->GetType() <= cmStateEnums::OBJECT_LIBRARY) { // Specify the compiler program database file if configured. std::string pdb = target->GetCompilePDBPath(configName); if (!pdb.empty()) { @@ -959,19 +960,19 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( static_cast(this->GlobalGenerator); std::string temp; std::string extraLinkOptions; - if (target->GetType() == cmState::EXECUTABLE) { + if (target->GetType() == cmStateEnums::EXECUTABLE) { extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS") + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_EXE_LINKER_FLAGS", configName); } - if (target->GetType() == cmState::SHARED_LIBRARY) { + if (target->GetType() == cmStateEnums::SHARED_LIBRARY) { extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_SHARED_LINKER_FLAGS") + std::string(" ") + GetBuildTypeLinkerFlags("CMAKE_SHARED_LINKER_FLAGS", configName); } - if (target->GetType() == cmState::MODULE_LIBRARY) { + if (target->GetType() == cmStateEnums::MODULE_LIBRARY) { extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS") + std::string(" ") + @@ -1004,7 +1005,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str()); } - if ((target->GetType() == cmState::SHARED_LIBRARY || + if ((target->GetType() == cmStateEnums::SHARED_LIBRARY || target->IsExecutableWithExports()) && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { if (target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { @@ -1012,9 +1013,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( } } switch (target->GetType()) { - case cmState::UNKNOWN_LIBRARY: + case cmStateEnums::UNKNOWN_LIBRARY: break; - case cmState::OBJECT_LIBRARY: { + case cmStateEnums::OBJECT_LIBRARY: { std::string libpath = this->GetTargetDirectory(target); libpath += "/"; libpath += configName; @@ -1029,7 +1030,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n"; break; } - case cmState::STATIC_LIBRARY: { + case cmStateEnums::STATIC_LIBRARY: { std::string targetNameFull = target->GetFullName(configName); std::string libpath = target->GetDirectory(configName); libpath += "/"; @@ -1059,8 +1060,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << "\"/>\n"; break; } - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: { + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: { std::string targetName; std::string targetNameSO; std::string targetNameFull; @@ -1145,7 +1146,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( } fout << "/>\n"; } break; - case cmState::EXECUTABLE: { + case cmStateEnums::EXECUTABLE: { std::string targetName; std::string targetNameFull; std::string targetNameImport; @@ -1241,9 +1242,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n"; break; } - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: + case cmStateEnums::INTERFACE_LIBRARY: break; } } @@ -1296,7 +1297,7 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries( lg->ConvertToRelativePath(currentBinDir, l->Value.c_str()); fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " "; } else if (!l->Target || - l->Target->GetType() != cmState::INTERFACE_LIBRARY) { + l->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { fout << l->Value << " "; } } @@ -1607,8 +1608,8 @@ bool cmLocalVisualStudio7Generator::WriteGroup( std::string source = (*sf)->GetFullPath(); FCInfo fcinfo(this, target, *(*sf), configs); - if (source != libName || target->GetType() == cmState::UTILITY || - target->GetType() == cmState::GLOBAL_TARGET) { + if (source != libName || target->GetType() == cmStateEnums::UTILITY || + target->GetType() == cmStateEnums::GLOBAL_TARGET) { fout << "\t\t\tConvertToXMLOutputPathSingle(source.c_str()); // Tell MS-Dev what the source is. If the compiler knows how to @@ -1812,7 +1813,7 @@ void cmLocalVisualStudio7Generator::OutputTargetRules( std::ostream& fout, const std::string& configName, cmGeneratorTarget* target, const std::string& /*libName*/) { - if (target->GetType() > cmState::GLOBAL_TARGET) { + if (target->GetType() > cmStateEnums::GLOBAL_TARGET) { return; } EventWriter event(this, configName, fout); @@ -1828,7 +1829,7 @@ void cmLocalVisualStudio7Generator::OutputTargetRules( tool = this->FortranProject ? "VFPreLinkEventTool" : "VCPreLinkEventTool"; event.Start(tool); bool addedPrelink = false; - if ((target->GetType() == cmState::SHARED_LIBRARY || + if ((target->GetType() == cmStateEnums::SHARED_LIBRARY || target->IsExecutableWithExports()) && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { if (target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { @@ -1900,27 +1901,27 @@ void cmLocalVisualStudio7Generator::WriteProjectStartFortran( } const char* projectType = 0; switch (target->GetType()) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: projectType = "typeStaticLibrary"; if (keyword) { keyword = "Static Library"; } break; - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: projectType = "typeDynamicLibrary"; if (!keyword) { keyword = "Dll"; } break; - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: if (!keyword) { keyword = "Console Application"; } projectType = 0; break; - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: default: break; } diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index e2b3cd2..e20fe50 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -76,8 +76,8 @@ cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target, // If an executable exports symbols then VS wants to create an // import library but forgets to create the output directory. // The Intel Fortran plugin always forgets to the directory. - if (target->GetType() != cmState::EXECUTABLE && - !(isFortran && target->GetType() == cmState::SHARED_LIBRARY)) { + if (target->GetType() != cmStateEnums::EXECUTABLE && + !(isFortran && target->GetType() == cmStateEnums::SHARED_LIBRARY)) { return pcc; } std::string outDir = target->GetDirectory(config, false); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c3111c0..65116d5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -730,7 +730,7 @@ void cmMakefile::AddCustomCommandToTarget( return; } - if (ti->second.GetType() == cmState::OBJECT_LIBRARY) { + if (ti->second.GetType() == cmStateEnums::OBJECT_LIBRARY) { std::ostringstream e; e << "Target \"" << target << "\" is an OBJECT library " @@ -738,7 +738,7 @@ void cmMakefile::AddCustomCommandToTarget( this->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } - if (ti->second.GetType() == cmState::INTERFACE_LIBRARY) { + if (ti->second.GetType() == cmStateEnums::INTERFACE_LIBRARY) { std::ostringstream e; e << "Target \"" << target << "\" is an INTERFACE library " @@ -1032,7 +1032,7 @@ cmTarget* cmMakefile::AddUtilityCommand( const char* comment, bool uses_terminal) { // Create a target instance for this utility. - cmTarget* target = this->AddNewTarget(cmState::UTILITY, utilityName); + cmTarget* target = this->AddNewTarget(cmStateEnums::UTILITY, utilityName); if (excludeFromAll) { target->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); } @@ -1774,9 +1774,9 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target) { // for these targets do not add anything switch (target.GetType()) { - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: + case cmStateEnums::INTERFACE_LIBRARY: return; default:; } @@ -1828,13 +1828,15 @@ void cmMakefile::AddAlias(const std::string& lname, std::string const& tgtName) } cmTarget* cmMakefile::AddLibrary(const std::string& lname, - cmState::TargetType type, + cmStateEnums::TargetType type, const std::vector& srcs, bool excludeFromAll) { - assert(type == cmState::STATIC_LIBRARY || type == cmState::SHARED_LIBRARY || - type == cmState::MODULE_LIBRARY || type == cmState::OBJECT_LIBRARY || - type == cmState::INTERFACE_LIBRARY); + assert(type == cmStateEnums::STATIC_LIBRARY || + type == cmStateEnums::SHARED_LIBRARY || + type == cmStateEnums::MODULE_LIBRARY || + type == cmStateEnums::OBJECT_LIBRARY || + type == cmStateEnums::INTERFACE_LIBRARY); cmTarget* target = this->AddNewTarget(type, lname); // Clear its dependencies. Otherwise, dependencies might persist @@ -1853,7 +1855,7 @@ cmTarget* cmMakefile::AddExecutable(const char* exeName, const std::vector& srcs, bool excludeFromAll) { - cmTarget* target = this->AddNewTarget(cmState::EXECUTABLE, exeName); + cmTarget* target = this->AddNewTarget(cmStateEnums::EXECUTABLE, exeName); if (excludeFromAll) { target->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); } @@ -1862,7 +1864,7 @@ cmTarget* cmMakefile::AddExecutable(const char* exeName, return target; } -cmTarget* cmMakefile::AddNewTarget(cmState::TargetType type, +cmTarget* cmMakefile::AddNewTarget(cmStateEnums::TargetType type, const std::string& name) { cmTargets::iterator it = @@ -2040,8 +2042,8 @@ void cmMakefile::ExpandVariablesCMP0019() for (cmTargets::iterator l = this->Targets.begin(); l != this->Targets.end(); ++l) { cmTarget& t = l->second; - if (t.GetType() == cmState::INTERFACE_LIBRARY || - t.GetType() == cmState::GLOBAL_TARGET) { + if (t.GetType() == cmStateEnums::INTERFACE_LIBRARY || + t.GetType() == cmStateEnums::GLOBAL_TARGET) { continue; } includeDirs = t.GetProperty("INCLUDE_DIRECTORIES"); @@ -3681,7 +3683,8 @@ void cmMakefile::RaiseScope(const std::string& var, const char* varDef) } cmTarget* cmMakefile::AddImportedTarget(const std::string& name, - cmState::TargetType type, bool global) + cmStateEnums::TargetType type, + bool global) { // Create the target. CM_AUTO_PTR target( @@ -3767,7 +3770,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, // The conflict is with a non-imported target. // Allow this if the user has requested support. cmake* cm = this->GetCMakeInstance(); - if (isCustom && existing->GetType() == cmState::UTILITY && + if (isCustom && existing->GetType() == cmStateEnums::UTILITY && this != existing->GetMakefile() && cm->GetState()->GetGlobalPropertyAsBool( "ALLOW_DUPLICATE_CUSTOM_TARGETS")) { @@ -3781,22 +3784,22 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, << "\" because another target with the same name already exists. " << "The existing target is "; switch (existing->GetType()) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: e << "an executable "; break; - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: e << "a static library "; break; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: e << "a shared library "; break; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: e << "a module library "; break; - case cmState::UTILITY: + case cmStateEnums::UTILITY: e << "a custom target "; break; - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: e << "an interface library "; break; default: diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 0116ce1..71078ab 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -163,9 +163,10 @@ public: /** Create a new imported target with the name and type given. */ cmTarget* AddImportedTarget(const std::string& name, - cmState::TargetType type, bool global); + cmStateEnums::TargetType type, bool global); - cmTarget* AddNewTarget(cmState::TargetType type, const std::string& name); + cmTarget* AddNewTarget(cmStateEnums::TargetType type, + const std::string& name); /** * Add an executable to the build. @@ -251,7 +252,8 @@ public: /** * Set the name of the library. */ - cmTarget* AddLibrary(const std::string& libname, cmState::TargetType type, + cmTarget* AddLibrary(const std::string& libname, + cmStateEnums::TargetType type, const std::vector& srcs, bool excludeFromAll = false); void AddAlias(const std::string& libname, const std::string& tgt); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 00a9100..5bf2f51 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -24,7 +24,7 @@ cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator( : cmMakefileTargetGenerator(target) { this->CustomCommandDriver = OnDepends; - if (this->GeneratorTarget->GetType() != cmState::INTERFACE_LIBRARY) { + if (this->GeneratorTarget->GetType() != cmStateEnums::INTERFACE_LIBRARY) { this->GeneratorTarget->GetLibraryNames( this->TargetNameOut, this->TargetNameSO, this->TargetNameReal, this->TargetNameImport, this->TargetNamePDB, this->ConfigName); @@ -57,24 +57,24 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles() // write the link rules // Write the rule for this target type. switch (this->GeneratorTarget->GetType()) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: this->WriteStaticLibraryRules(); break; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: this->WriteSharedLibraryRules(false); if (this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName)) { // Write rules to link an installable version of the target. this->WriteSharedLibraryRules(true); } break; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: this->WriteModuleLibraryRules(false); if (this->GeneratorTarget->NeedRelinkBeforeInstall(this->ConfigName)) { // Write rules to link an installable version of the target. this->WriteModuleLibraryRules(true); } break; - case cmState::OBJECT_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: this->WriteObjectLibraryRules(); break; default: @@ -251,8 +251,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( this->LocalGenerator->AppendFlags(linkFlags, extraFlags); // Add OSX version flags, if any. - if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || - this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { this->AppendOSXVerFlag(linkFlags, linkLanguage, "COMPATIBILITY", true); this->AppendOSXVerFlag(linkFlags, linkLanguage, "CURRENT", false); } @@ -345,13 +345,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::string buildEcho = "Linking "; buildEcho += linkLanguage; switch (this->GeneratorTarget->GetType()) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: buildEcho += " static library "; break; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: buildEcho += " shared library "; break; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: if (this->GeneratorTarget->IsCFBundleOnApple()) { buildEcho += " CFBundle"; } @@ -399,7 +399,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( #ifdef _WIN32 // There may be a manifest file for this target. Add it to the // clean set just in case. - if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) { + if (this->GeneratorTarget->GetType() != cmStateEnums::STATIC_LIBRARY) { libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( this->LocalGenerator->GetCurrentBinaryDirectory(), (targetFullPath + ".manifest").c_str())); @@ -409,7 +409,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::vector commands1; // Add a command to remove any existing files for this library. // for static libs only - if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles, this->GeneratorTarget, "target"); this->LocalGenerator->CreateCDCommand( @@ -443,7 +443,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::vector archiveAppendCommands; std::vector archiveFinishCommands; std::string::size_type archiveCommandLimit = std::string::npos; - if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { haveStaticLibraryRule = this->Makefile->IsDefinitionSet(linkRuleVar); std::string arCreateVar = "CMAKE_"; arCreateVar += linkLanguage; @@ -492,7 +492,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Collect up flags to link in needed libraries. std::string linkLibs; - if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) { + if (this->GeneratorTarget->GetType() != cmStateEnums::STATIC_LIBRARY) { CM_AUTO_PTR linkLineComputer( this->CreateLinkLineComputer( @@ -514,7 +514,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( useWatcomQuote); // maybe create .def file from list of objects - if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY && + if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { this->GenDefFile(real_link_commands, linkFlags); } @@ -574,7 +574,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Compute the directory portion of the install_name setting. std::string install_name_dir; - if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY) { // Get the install_name directory for the build tree. install_name_dir = this->GeneratorTarget->GetInstallNameDirForBuildTree(this->ConfigName); @@ -659,7 +659,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( std::string linkRule = this->GetLinkRule(linkRuleVar); cmSystemTools::ExpandListArgument(linkRule, real_link_commands); if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE") && - (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) { + (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY)) { std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); cmakeCommand += " -E __run_iwyu --lwyu="; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index cbfe850..f0502bf 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -68,16 +68,16 @@ cmMakefileTargetGenerator* cmMakefileTargetGenerator::New( cmMakefileTargetGenerator* result = CM_NULLPTR; switch (tgt->GetType()) { - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: result = new cmMakefileExecutableTargetGenerator(tgt); break; - case cmState::STATIC_LIBRARY: - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: result = new cmMakefileLibraryTargetGenerator(tgt); break; - case cmState::UTILITY: + case cmStateEnums::UTILITY: result = new cmMakefileUtilityTargetGenerator(tgt); break; default: @@ -504,10 +504,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string targetFullPathReal; std::string targetFullPathPDB; std::string targetFullPathCompilePDB; - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE || - this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY || - this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || - this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE || + this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { targetFullPathReal = this->GeneratorTarget->GetFullPath(this->ConfigName, false, true); targetFullPathPDB = @@ -515,7 +515,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( targetFullPathPDB += "/"; targetFullPathPDB += this->GeneratorTarget->GetPDBName(this->ConfigName); } - if (this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { + if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) { targetFullPathCompilePDB = this->GeneratorTarget->GetCompilePDBPath(this->ConfigName); if (targetFullPathCompilePDB.empty()) { @@ -1346,7 +1346,7 @@ void cmMakefileTargetGenerator::AppendTargetDepends( std::vector& depends) { // Static libraries never depend on anything for linking. - if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { return; } diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index b28b19a..dd903d6 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -45,7 +45,7 @@ cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator( , TargetLinkLanguage("") { this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName()); - if (target->GetType() == cmState::EXECUTABLE) { + if (target->GetType() == cmStateEnums::EXECUTABLE) { this->GetGeneratorTarget()->GetExecutableNames( this->TargetNameOut, this->TargetNameReal, this->TargetNameImport, this->TargetNamePDB, GetLocalGenerator()->GetConfigName()); @@ -56,7 +56,7 @@ cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator( GetLocalGenerator()->GetConfigName()); } - if (target->GetType() != cmState::OBJECT_LIBRARY) { + if (target->GetType() != cmStateEnums::OBJECT_LIBRARY) { // on Windows the output dir is already needed at compile time // ensure the directory exists (OutDir test) EnsureDirectoryExists(target->GetDirectory(this->GetConfigName())); @@ -87,7 +87,7 @@ void cmNinjaNormalTargetGenerator::Generate() // Write the build statements this->WriteObjectBuildStatements(); - if (this->GetGeneratorTarget()->GetType() == cmState::OBJECT_LIBRARY) { + if (this->GetGeneratorTarget()->GetType() == cmStateEnums::OBJECT_LIBRARY) { this->WriteObjectLibStatement(); } else { this->WriteLinkStatement(); @@ -125,17 +125,17 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules() const char* cmNinjaNormalTargetGenerator::GetVisibleTypeName() const { switch (this->GetGeneratorTarget()->GetType()) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return "static library"; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return "shared library"; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: if (this->GetGeneratorTarget()->IsCFBundleOnApple()) { return "CFBundle shared module"; } else { return "shared module"; } - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return "executable"; default: return CM_NULLPTR; @@ -160,7 +160,7 @@ struct cmNinjaRemoveNoOpCommands void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) { - cmState::TargetType targetType = this->GetGeneratorTarget()->GetType(); + cmStateEnums::TargetType targetType = this->GetGeneratorTarget()->GetType(); std::string ruleName = this->LanguageLinkerRule(); // Select whether to use a response file for objects. @@ -236,7 +236,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) vars.Manifests = "$MANIFESTS"; std::string langFlags; - if (targetType != cmState::EXECUTABLE) { + if (targetType != cmStateEnums::EXECUTABLE) { langFlags += "$LANGUAGE_COMPILE_FLAGS $ARCH_FLAGS"; vars.LanguageCompileFlags = langFlags.c_str(); } @@ -292,7 +292,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile) std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL); - if (targetType == cmState::EXECUTABLE) { + if (targetType == cmStateEnums::EXECUTABLE) { this->GetGlobalGenerator()->AddRule( "CMAKE_SYMLINK_EXECUTABLE", cmakeCommand + " -E cmake_symlink_executable" @@ -352,7 +352,7 @@ std::vector cmNinjaNormalTargetGenerator::ComputeLinkCmd() } } switch (this->GetGeneratorTarget()->GetType()) { - case cmState::STATIC_LIBRARY: { + case cmStateEnums::STATIC_LIBRARY: { // We have archive link commands set. First, delete the existing archive. { std::string cmakeCommand = @@ -377,9 +377,9 @@ std::vector cmNinjaNormalTargetGenerator::ComputeLinkCmd() } return linkCmds; } - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::EXECUTABLE: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::EXECUTABLE: break; default: assert(0 && "Unexpected target type"); @@ -452,7 +452,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // Write comments. cmGlobalNinjaGenerator::WriteDivider(this->GetBuildFileStream()); - const cmState::TargetType targetType = gt.GetType(); + const cmStateEnums::TargetType targetType = gt.GetType(); this->GetBuildFileStream() << "# Link build statements for " << cmState::GetTargetTypeName(targetType) << " target " << this->GetTargetName() << "\n\n"; @@ -497,7 +497,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() linkLineComputer.get(), this->GetConfigName(), vars["LINK_LIBRARIES"], vars["FLAGS"], vars["LINK_FLAGS"], frameworkPath, linkPath, &genTarget); if (this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS") && - (gt.GetType() == cmState::SHARED_LIBRARY || + (gt.GetType() == cmStateEnums::SHARED_LIBRARY || gt.IsExecutableWithExports())) { if (gt.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { std::string name_of_def_file = gt.GetSupportDirectory(); @@ -510,8 +510,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } // Add OS X version flags, if any. - if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || - this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { this->AppendOSXVerFlag(vars["LINK_FLAGS"], this->TargetLinkLanguage, "COMPATIBILITY", true); this->AppendOSXVerFlag(vars["LINK_FLAGS"], this->TargetLinkLanguage, @@ -535,7 +535,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() // Compute architecture specific link flags. Yes, these go into a different // variable for executables, probably due to a mistake made when duplicating // code between the Makefile executable and library generators. - if (targetType == cmState::EXECUTABLE) { + if (targetType == cmStateEnums::EXECUTABLE) { std::string t = vars["FLAGS"]; localGen.AddArchitectureFlags(t, &genTarget, TargetLinkLanguage, cfgName); t += lwyuFlags; @@ -552,7 +552,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() if (this->GetGeneratorTarget()->HasSOName(cfgName)) { vars["SONAME_FLAG"] = mf->GetSONameFlag(this->TargetLinkLanguage); vars["SONAME"] = this->TargetNameSO; - if (targetType == cmState::SHARED_LIBRARY) { + if (targetType == cmStateEnums::SHARED_LIBRARY) { std::string install_dir = this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName); if (!install_dir.empty()) { @@ -625,7 +625,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() } // maybe create .def file from list of objects - if ((gt.GetType() == cmState::SHARED_LIBRARY || + if ((gt.GetType() == cmStateEnums::SHARED_LIBRARY || gt.IsExecutableWithExports()) && this->GetMakefile()->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { if (gt.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { @@ -713,7 +713,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() this->WriteLinkRule(usedResponseFile); if (symlinkNeeded) { - if (targetType == cmState::EXECUTABLE) { + if (targetType == cmStateEnums::EXECUTABLE) { globalGen.WriteBuild( this->GetBuildFileStream(), "Create executable symlink " + targetOutput, diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 1ac6cd4..6552832 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -31,15 +31,15 @@ cmNinjaTargetGenerator* cmNinjaTargetGenerator::New(cmGeneratorTarget* target) { switch (target->GetType()) { - case cmState::EXECUTABLE: - case cmState::SHARED_LIBRARY: - case cmState::STATIC_LIBRARY: - case cmState::MODULE_LIBRARY: - case cmState::OBJECT_LIBRARY: + case cmStateEnums::EXECUTABLE: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: return new cmNinjaNormalTargetGenerator(target); - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: return new cmNinjaUtilityTargetGenerator(target); default: @@ -186,8 +186,8 @@ std::string cmNinjaTargetGenerator::ComputeDefines(cmSourceFile const* source, cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const { // Static libraries never depend on other targets for linking. - if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY || - this->GeneratorTarget->GetType() == cmState::OBJECT_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::OBJECT_LIBRARY) { return cmNinjaDeps(); } @@ -335,15 +335,15 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID")) { std::string pdbPath; std::string compilePdbPath; - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE || - this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY || - this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || - this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE || + this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { pdbPath = this->GeneratorTarget->GetPDBDirectory(this->GetConfigName()); pdbPath += "/"; pdbPath += this->GeneratorTarget->GetPDBName(this->GetConfigName()); } - if (this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { + if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) { compilePdbPath = this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName()); if (compilePdbPath.empty()) { diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 17e35e5..7de185a 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -151,7 +151,7 @@ void cmNinjaUtilityTargetGenerator::Generate() // Add an alias for the logical target name regardless of what directory // contains it. Skip this for GLOBAL_TARGET because they are meant to // be per-directory and have one at the top-level anyway. - if (this->GetGeneratorTarget()->GetType() != cmState::GLOBAL_TARGET) { + if (this->GetGeneratorTarget()->GetType() != cmStateEnums::GLOBAL_TARGET) { this->GetGlobalGenerator()->AddTargetAlias(this->GetTargetName(), this->GetGeneratorTarget()); } diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index a9a3ce2..d332ed7 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -684,7 +684,7 @@ static Json::Value DumpTarget(cmGeneratorTarget* target, cmLocalGenerator* lg = target->GetLocalGenerator(); const cmState* state = lg->GetState(); - const cmState::TargetType type = target->GetType(); + const cmStateEnums::TargetType type = target->GetType(); const std::string typeName = state->GetTargetTypeName(type); Json::Value ttl = Json::arrayValue; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ca0295a..cdadbda 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -117,26 +117,26 @@ cmState::~cmState() cmDeleteAll(this->Commands); } -const char* cmState::GetTargetTypeName(cmState::TargetType targetType) +const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType) { switch (targetType) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return "STATIC_LIBRARY"; - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: return "MODULE_LIBRARY"; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return "SHARED_LIBRARY"; - case cmState::OBJECT_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: return "OBJECT_LIBRARY"; - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return "EXECUTABLE"; - case cmState::UTILITY: + case cmStateEnums::UTILITY: return "UTILITY"; - case cmState::GLOBAL_TARGET: + case cmStateEnums::GLOBAL_TARGET: return "GLOBAL_TARGET"; - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: return "INTERFACE_LIBRARY"; - case cmState::UNKNOWN_LIBRARY: + case cmStateEnums::UNKNOWN_LIBRARY: return "UNKNOWN_LIBRARY"; } assert(0 && "Unexpected target type"); diff --git a/Source/cmState.h b/Source/cmState.h index 8f0b5ee..521870d 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -43,6 +43,19 @@ enum SnapshotType PolicyScopeType, VariableScopeType }; + +enum TargetType +{ + EXECUTABLE, + STATIC_LIBRARY, + SHARED_LIBRARY, + MODULE_LIBRARY, + OBJECT_LIBRARY, + UTILITY, + GLOBAL_TARGET, + INTERFACE_LIBRARY, + UNKNOWN_LIBRARY +}; } class cmState @@ -185,20 +198,7 @@ public: friend class Snapshot; }; - enum TargetType - { - EXECUTABLE, - STATIC_LIBRARY, - SHARED_LIBRARY, - MODULE_LIBRARY, - OBJECT_LIBRARY, - UTILITY, - GLOBAL_TARGET, - INTERFACE_LIBRARY, - UNKNOWN_LIBRARY - }; - - static const char* GetTargetTypeName(cmState::TargetType targetType); + static const char* GetTargetTypeName(cmStateEnums::TargetType targetType); Snapshot CreateBaseSnapshot(); Snapshot CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3a22309..5753dd8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -180,7 +180,7 @@ public: std::vector LinkImplementationPropertyBacktraces; }; -cmTarget::cmTarget(std::string const& name, cmState::TargetType type, +cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, Visibility vis, cmMakefile* mf) { assert(mf); @@ -196,8 +196,8 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type, this->BuildInterfaceIncludesAppended = false; // only add dependency information for library targets - if (this->TargetTypeValue >= cmState::STATIC_LIBRARY && - this->TargetTypeValue <= cmState::MODULE_LIBRARY) { + if (this->TargetTypeValue >= cmStateEnums::STATIC_LIBRARY && + this->TargetTypeValue <= cmStateEnums::MODULE_LIBRARY) { this->RecordDependencies = true; } else { this->RecordDependencies = false; @@ -214,8 +214,8 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type, "Android") == 0; // Setup default property values. - if (this->GetType() != cmState::INTERFACE_LIBRARY && - this->GetType() != cmState::UTILITY) { + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && + this->GetType() != cmStateEnums::UTILITY) { this->SetPropertyDefault("ANDROID_API", CM_NULLPTR); this->SetPropertyDefault("ANDROID_API_MIN", CM_NULLPTR); this->SetPropertyDefault("ANDROID_ARCH", CM_NULLPTR); @@ -282,7 +282,7 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type, mf->GetConfigurations(configNames); // Setup per-configuration property default values. - if (this->GetType() != cmState::UTILITY) { + if (this->GetType() != cmStateEnums::UTILITY) { const char* configProps[] = { /* clang-format needs this comment to break after the opening brace */ "ARCHIVE_OUTPUT_DIRECTORY_", @@ -297,7 +297,7 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type, ci != configNames.end(); ++ci) { std::string configUpper = cmSystemTools::UpperCase(*ci); for (const char** p = configProps; *p; ++p) { - if (this->TargetTypeValue == cmState::INTERFACE_LIBRARY && + if (this->TargetTypeValue == cmStateEnums::INTERFACE_LIBRARY && strcmp(*p, "MAP_IMPORTED_CONFIG_") != 0) { continue; } @@ -311,8 +311,8 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type, // compatibility with previous CMake versions in which executables // did not support this variable. Projects may still specify the // property directly. - if (this->TargetTypeValue != cmState::EXECUTABLE && - this->TargetTypeValue != cmState::INTERFACE_LIBRARY) { + if (this->TargetTypeValue != cmStateEnums::EXECUTABLE && + this->TargetTypeValue != cmStateEnums::INTERFACE_LIBRARY) { std::string property = cmSystemTools::UpperCase(*ci); property += "_POSTFIX"; this->SetPropertyDefault(property, CM_NULLPTR); @@ -357,44 +357,45 @@ cmTarget::cmTarget(std::string const& name, cmState::TargetType type, parentOptionsBts.end()); } - if (this->GetType() != cmState::INTERFACE_LIBRARY && - this->GetType() != cmState::UTILITY) { + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && + this->GetType() != cmStateEnums::UTILITY) { this->SetPropertyDefault("C_VISIBILITY_PRESET", CM_NULLPTR); this->SetPropertyDefault("CXX_VISIBILITY_PRESET", CM_NULLPTR); this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", CM_NULLPTR); } - if (this->TargetTypeValue == cmState::EXECUTABLE) { + if (this->TargetTypeValue == cmStateEnums::EXECUTABLE) { this->SetPropertyDefault("ANDROID_GUI", CM_NULLPTR); this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", CM_NULLPTR); this->SetPropertyDefault("ENABLE_EXPORTS", CM_NULLPTR); } - if (this->TargetTypeValue == cmState::SHARED_LIBRARY || - this->TargetTypeValue == cmState::MODULE_LIBRARY) { + if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY || + this->TargetTypeValue == cmStateEnums::MODULE_LIBRARY) { this->SetProperty("POSITION_INDEPENDENT_CODE", "True"); } - if (this->TargetTypeValue == cmState::SHARED_LIBRARY || - this->TargetTypeValue == cmState::EXECUTABLE) { + if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY || + this->TargetTypeValue == cmStateEnums::EXECUTABLE) { this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", CM_NULLPTR); } - if (this->GetType() != cmState::INTERFACE_LIBRARY && - this->GetType() != cmState::UTILITY) { + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && + this->GetType() != cmStateEnums::UTILITY) { this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", CM_NULLPTR); } // Record current policies for later use. this->Makefile->RecordPolicies(this->PolicyMap); - if (this->TargetTypeValue == cmState::INTERFACE_LIBRARY) { + if (this->TargetTypeValue == cmStateEnums::INTERFACE_LIBRARY) { // This policy is checked in a few conditions. The properties relevant - // to the policy are always ignored for cmState::INTERFACE_LIBRARY targets, + // to the policy are always ignored for cmStateEnums::INTERFACE_LIBRARY + // targets, // so ensure that the conditions don't lead to nonsense. this->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW); } - if (this->GetType() != cmState::INTERFACE_LIBRARY && - this->GetType() != cmState::UTILITY) { + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && + this->GetType() != cmStateEnums::UTILITY) { this->SetPropertyDefault("JOB_POOL_COMPILE", CM_NULLPTR); this->SetPropertyDefault("JOB_POOL_LINK", CM_NULLPTR); } @@ -432,26 +433,27 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const bool cmTarget::IsExecutableWithExports() const { - return (this->GetType() == cmState::EXECUTABLE && + return (this->GetType() == cmStateEnums::EXECUTABLE && this->GetPropertyAsBool("ENABLE_EXPORTS")); } bool cmTarget::HasImportLibrary() const { - return (this->DLLPlatform && (this->GetType() == cmState::SHARED_LIBRARY || - this->IsExecutableWithExports())); + return (this->DLLPlatform && + (this->GetType() == cmStateEnums::SHARED_LIBRARY || + this->IsExecutableWithExports())); } bool cmTarget::IsFrameworkOnApple() const { - return (this->GetType() == cmState::SHARED_LIBRARY && + return (this->GetType() == cmStateEnums::SHARED_LIBRARY && this->Makefile->IsOn("APPLE") && this->GetPropertyAsBool("FRAMEWORK")); } bool cmTarget::IsAppBundleOnApple() const { - return (this->GetType() == cmState::EXECUTABLE && + return (this->GetType() == cmStateEnums::EXECUTABLE && this->Makefile->IsOn("APPLE") && this->GetPropertyAsBool("MACOSX_BUNDLE")); } @@ -730,7 +732,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib, } if (cmGeneratorExpression::Find(lib) != std::string::npos || - (tgt && tgt->GetType() == cmState::INTERFACE_LIBRARY) || + (tgt && tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) || (this->Name == lib)) { return; } @@ -986,10 +988,10 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, void cmTarget::AppendBuildInterfaceIncludes() { - if (this->GetType() != cmState::SHARED_LIBRARY && - this->GetType() != cmState::STATIC_LIBRARY && - this->GetType() != cmState::MODULE_LIBRARY && - this->GetType() != cmState::INTERFACE_LIBRARY && + if (this->GetType() != cmStateEnums::SHARED_LIBRARY && + this->GetType() != cmStateEnums::STATIC_LIBRARY && + this->GetType() != cmStateEnums::MODULE_LIBRARY && + this->GetType() != cmStateEnums::INTERFACE_LIBRARY && !this->IsExecutableWithExports()) { return; } @@ -1255,15 +1257,15 @@ bool cmTarget::GetPropertyAsBool(const std::string& prop) const const char* cmTarget::GetSuffixVariableInternal(bool implib) const { switch (this->GetType()) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return "CMAKE_STATIC_LIBRARY_SUFFIX"; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX" : "CMAKE_SHARED_LIBRARY_SUFFIX"); - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX" : "CMAKE_SHARED_MODULE_SUFFIX"); - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX" // Android GUI application packages store the native @@ -1280,15 +1282,15 @@ const char* cmTarget::GetSuffixVariableInternal(bool implib) const const char* cmTarget::GetPrefixVariableInternal(bool implib) const { switch (this->GetType()) { - case cmState::STATIC_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: return "CMAKE_STATIC_LIBRARY_PREFIX"; - case cmState::SHARED_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: return (implib ? "CMAKE_IMPORT_LIBRARY_PREFIX" : "CMAKE_SHARED_LIBRARY_PREFIX"); - case cmState::MODULE_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: return (implib ? "CMAKE_IMPORT_LIBRARY_PREFIX" : "CMAKE_SHARED_MODULE_PREFIX"); - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: return (implib ? "CMAKE_IMPORT_LIBRARY_PREFIX" // Android GUI application packages store the native @@ -1322,7 +1324,7 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config, const char* imp = CM_NULLPTR; std::string suffix; - if (this->GetType() != cmState::INTERFACE_LIBRARY && + if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && this->GetMappedConfig(config_upper, &loc, &imp, suffix)) { if (!pimplib) { if (loc) { @@ -1340,7 +1342,7 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config, } else { if (imp) { result = imp; - } else if (this->GetType() == cmState::SHARED_LIBRARY || + } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY || this->IsExecutableWithExports()) { std::string impProp = "IMPORTED_IMPLIB"; impProp += suffix; @@ -1378,9 +1380,10 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, const char** loc, const char** imp, std::string& suffix) const { - if (this->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { // This method attempts to find a config-specific LOCATION for the - // IMPORTED library. In the case of cmState::INTERFACE_LIBRARY, there is no + // IMPORTED library. In the case of cmStateEnums::INTERFACE_LIBRARY, there + // is no // LOCATION at all, so leaving *loc and *imp unchanged is the appropriate // and valid response. return true; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index bd00b3d..6a7c8f0 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -62,8 +62,8 @@ public: VisibilityImportedGlobally }; - cmTarget(std::string const& name, cmState::TargetType type, Visibility vis, - cmMakefile* mf); + cmTarget(std::string const& name, cmStateEnums::TargetType type, + Visibility vis, cmMakefile* mf); enum CustomCommandType { @@ -75,7 +75,7 @@ public: /** * Return the type of target. */ - cmState::TargetType GetType() const { return this->TargetTypeValue; } + cmStateEnums::TargetType GetType() const { return this->TargetTypeValue; } cmGlobalGenerator* GetGlobalGenerator() const; @@ -302,7 +302,7 @@ private: LinkLibraryVectorType OriginalLinkLibraries; cmMakefile* Makefile; cmTargetInternalPointer Internal; - cmState::TargetType TargetTypeValue; + cmStateEnums::TargetType TargetTypeValue; bool HaveInstallRule; bool RecordDependencies; bool DLLPlatform; diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index d1de7ef..804dc5a 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -71,7 +71,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass( return true; } - if (this->Target->GetType() == cmState::OBJECT_LIBRARY) { + if (this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) { std::ostringstream e; e << "Object library target \"" << args[0] << "\" " << "may not link to anything."; @@ -80,7 +80,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass( return true; } - if (this->Target->GetType() == cmState::UTILITY) { + if (this->Target->GetType() == cmStateEnums::UTILITY) { std::ostringstream e; const char* modal = CM_NULLPTR; cmake::MessageType messageType = cmake::AUTHOR_WARNING; @@ -278,7 +278,7 @@ void cmTargetLinkLibrariesCommand::LinkLibraryTypeSpecifierWarning(int left, bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, cmTargetLinkLibraryType llt) { - if (this->Target->GetType() == cmState::INTERFACE_LIBRARY && + if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY && this->CurrentProcessingState != ProcessingKeywordLinkInterface) { this->Makefile->IssueMessage( cmake::FATAL_ERROR, @@ -351,9 +351,9 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, cmTarget* tgt = this->Makefile->GetGlobalGenerator()->FindTarget(lib); - if (tgt && (tgt->GetType() != cmState::STATIC_LIBRARY) && - (tgt->GetType() != cmState::SHARED_LIBRARY) && - (tgt->GetType() != cmState::INTERFACE_LIBRARY) && + if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) && + (tgt->GetType() != cmStateEnums::SHARED_LIBRARY) && + (tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) && !tgt->IsExecutableWithExports()) { std::ostringstream e; e << "Target \"" << lib << "\" of type " @@ -375,7 +375,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, } if (this->CurrentProcessingState != ProcessingKeywordPublicInterface && this->CurrentProcessingState != ProcessingPlainPublicInterface) { - if (this->Target->GetType() == cmState::STATIC_LIBRARY) { + if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) { std::string configLib = this->Target->GetDebugGeneratorExpressions(lib, llt); if (cmGeneratorExpression::IsValidTargetName(lib) || @@ -403,7 +403,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, return true; } - if (this->Target->GetType() == cmState::INTERFACE_LIBRARY) { + if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) { return true; } diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx index a00360b..e2e02ad 100644 --- a/Source/cmTargetPropCommandBase.cxx +++ b/Source/cmTargetPropCommandBase.cxx @@ -28,12 +28,12 @@ bool cmTargetPropCommandBase::HandleArguments( this->HandleMissingTarget(args[0]); return false; } - if ((this->Target->GetType() != cmState::SHARED_LIBRARY) && - (this->Target->GetType() != cmState::STATIC_LIBRARY) && - (this->Target->GetType() != cmState::OBJECT_LIBRARY) && - (this->Target->GetType() != cmState::MODULE_LIBRARY) && - (this->Target->GetType() != cmState::INTERFACE_LIBRARY) && - (this->Target->GetType() != cmState::EXECUTABLE)) { + if ((this->Target->GetType() != cmStateEnums::SHARED_LIBRARY) && + (this->Target->GetType() != cmStateEnums::STATIC_LIBRARY) && + (this->Target->GetType() != cmStateEnums::OBJECT_LIBRARY) && + (this->Target->GetType() != cmStateEnums::MODULE_LIBRARY) && + (this->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) && + (this->Target->GetType() != cmStateEnums::EXECUTABLE)) { this->SetError("called with non-compilable target type"); return false; } @@ -86,7 +86,7 @@ bool cmTargetPropCommandBase::ProcessContentArgs( return false; } - if (this->Target->GetType() == cmState::INTERFACE_LIBRARY && + if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY && scope != "INTERFACE") { this->SetError("may only be set INTERFACE properties on INTERFACE " "targets"); diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index 21408d1..36d1940 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -83,10 +83,10 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty( } bool cmTargetPropertyComputer::PassesWhitelist( - cmState::TargetType tgtType, std::string const& prop, cmMessenger* messenger, - cmListFileBacktrace const& context) + cmStateEnums::TargetType tgtType, std::string const& prop, + cmMessenger* messenger, cmListFileBacktrace const& context) { - if (tgtType == cmState::INTERFACE_LIBRARY && + if (tgtType == cmStateEnums::INTERFACE_LIBRARY && !WhiteListedInterfaceProperty(prop)) { std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h index ed9a4e2..f8b683a 100644 --- a/Source/cmTargetPropertyComputer.h +++ b/Source/cmTargetPropertyComputer.h @@ -36,7 +36,7 @@ public: static bool WhiteListedInterfaceProperty(const std::string& prop); - static bool PassesWhitelist(cmState::TargetType tgtType, + static bool PassesWhitelist(cmStateEnums::TargetType tgtType, std::string const& prop, cmMessenger* messenger, cmListFileBacktrace const& context); @@ -59,11 +59,11 @@ private: { // Watch for special "computed" properties that are dependent on // other properties or variables. Always recompute them. - if (tgt->GetType() == cmState::EXECUTABLE || - tgt->GetType() == cmState::STATIC_LIBRARY || - tgt->GetType() == cmState::SHARED_LIBRARY || - tgt->GetType() == cmState::MODULE_LIBRARY || - tgt->GetType() == cmState::UNKNOWN_LIBRARY) { + if (tgt->GetType() == cmStateEnums::EXECUTABLE || + tgt->GetType() == cmStateEnums::STATIC_LIBRARY || + tgt->GetType() == cmStateEnums::SHARED_LIBRARY || + tgt->GetType() == cmStateEnums::MODULE_LIBRARY || + tgt->GetType() == cmStateEnums::UNKNOWN_LIBRARY) { static const std::string propLOCATION = "LOCATION"; if (prop == propLOCATION) { if (!tgt->IsImported() && diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 3ea59cb..301660e 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -77,7 +77,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, // be translated. std::string exe = command[0]; cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(exe); - if (target && target->GetType() == cmState::EXECUTABLE) { + if (target && target->GetType() == cmStateEnums::EXECUTABLE) { // Use the target file on disk. exe = target->GetFullPath(config); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8524ecc..9c857f2 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -255,7 +255,7 @@ void cmVisualStudio10TargetGenerator::WriteString(const char* line, void cmVisualStudio10TargetGenerator::Generate() { // do not generate external ms projects - if (this->GeneratorTarget->GetType() == cmState::INTERFACE_LIBRARY || + if (this->GeneratorTarget->GetType() == cmStateEnums::INTERFACE_LIBRARY || this->GeneratorTarget->GetProperty("EXTERNAL_MSPROJECT")) { return; } @@ -264,7 +264,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->Name.c_str()); this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME_EXT", ".vcxproj"); - if (this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { + if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) { if (!this->ComputeClOptions()) { return; } @@ -344,7 +344,7 @@ void cmVisualStudio10TargetGenerator::Generate() (*this->BuildFileStream) << "{" << this->GUID << "}\n"; if (this->MSTools && - this->GeneratorTarget->GetType() <= cmState::GLOBAL_TARGET) { + this->GeneratorTarget->GetType() <= cmStateEnums::GLOBAL_TARGET) { this->WriteApplicationTypeSettings(); this->VerifyNecessaryFiles(); } @@ -655,15 +655,15 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += cmVS10EscapeXML(vsConfigurationType); } else { switch (this->GeneratorTarget->GetType()) { - case cmState::SHARED_LIBRARY: - case cmState::MODULE_LIBRARY: + case cmStateEnums::SHARED_LIBRARY: + case cmStateEnums::MODULE_LIBRARY: configType += "DynamicLibrary"; break; - case cmState::OBJECT_LIBRARY: - case cmState::STATIC_LIBRARY: + case cmStateEnums::OBJECT_LIBRARY: + case cmStateEnums::STATIC_LIBRARY: configType += "StaticLibrary"; break; - case cmState::EXECUTABLE: + case cmStateEnums::EXECUTABLE: if (this->NsightTegra && !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { // Android executables are .so too. @@ -672,8 +672,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += "Application"; } break; - case cmState::UTILITY: - case cmState::GLOBAL_TARGET: + case cmStateEnums::UTILITY: + case cmStateEnums::GLOBAL_TARGET: if (this->NsightTegra) { // Tegra-Android platform does not understand "Utility". configType += "StaticLibrary"; @@ -681,8 +681,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += "Utility"; } break; - case cmState::UNKNOWN_LIBRARY: - case cmState::INTERFACE_LIBRARY: + case cmStateEnums::UNKNOWN_LIBRARY: + case cmStateEnums::INTERFACE_LIBRARY: break; } } @@ -710,7 +710,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues( std::string mfcFlagValue = mfcFlag ? mfcFlag : "0"; std::string useOfMfcValue = "false"; - if (this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { + if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) { if (mfcFlagValue == "1") { useOfMfcValue = "Static"; } else if (mfcFlagValue == "2") { @@ -721,14 +721,15 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues( mfcLine += useOfMfcValue + "\n"; this->WriteString(mfcLine.c_str(), 2); - if ((this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY && + if ((this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY && this->ClOptions[config]->UsingUnicode()) || this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") || this->GlobalGenerator->TargetsWindowsPhone() || this->GlobalGenerator->TargetsWindowsStore() || this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS")) { this->WriteString("Unicode\n", 2); - } else if (this->GeneratorTarget->GetType() <= cmState::MODULE_LIBRARY && + } else if (this->GeneratorTarget->GetType() <= + cmStateEnums::MODULE_LIBRARY && this->ClOptions[config]->UsingSBCS()) { this->WriteString("NotSet\n", 2); } else { @@ -1351,7 +1352,7 @@ void cmVisualStudio10TargetGenerator::WriteSources( void cmVisualStudio10TargetGenerator::WriteAllSources() { - if (this->GeneratorTarget->GetType() > cmState::UTILITY) { + if (this->GeneratorTarget->GetType() > cmStateEnums::UTILITY) { return; } this->WriteString("\n", 1); @@ -1573,8 +1574,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() { - cmState::TargetType ttype = this->GeneratorTarget->GetType(); - if (ttype > cmState::GLOBAL_TARGET) { + cmStateEnums::TargetType ttype = this->GeneratorTarget->GetType(); + if (ttype > cmStateEnums::GLOBAL_TARGET) { return; } @@ -1585,7 +1586,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() for (std::vector::const_iterator config = this->Configurations.begin(); config != this->Configurations.end(); ++config) { - if (ttype >= cmState::UTILITY) { + if (ttype >= cmStateEnums::UTILITY) { this->WritePlatformConfigTag("IntDir", config->c_str(), 3); *this->BuildFileStream << "$(Platform)\\$(Configuration)\\$(ProjectName)\\" @@ -1598,7 +1599,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() intermediateDir += "/"; std::string outDir; std::string targetNameFull; - if (ttype == cmState::OBJECT_LIBRARY) { + if (ttype == cmStateEnums::OBJECT_LIBRARY) { outDir = intermediateDir; targetNameFull = this->GeneratorTarget->GetName(); targetNameFull += ".lib"; @@ -1645,8 +1646,8 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental( } // static libraries and things greater than modules do not need // to set this option - if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY || - this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GeneratorTarget->GetType() > cmStateEnums::MODULE_LIBRARY) { return; } Options& linkOptions = *(this->LinkOptions[configName]); @@ -1767,8 +1768,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT")) { clOptions.AddFlag("CompileAsWinRT", "true"); // For WinRT components, add the _WINRT_DLL define to produce a lib - if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || - this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { clOptions.AddDefine("_WINRT_DLL"); } } else if (this->GlobalGenerator->TargetsWindowsStore() || @@ -1958,8 +1959,8 @@ void cmVisualStudio10TargetGenerator::WriteMasmOptions( void cmVisualStudio10TargetGenerator::WriteLibOptions( std::string const& config) { - if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY && - this->GeneratorTarget->GetType() != cmState::OBJECT_LIBRARY) { + if (this->GeneratorTarget->GetType() != cmStateEnums::STATIC_LIBRARY && + this->GeneratorTarget->GetType() != cmStateEnums::OBJECT_LIBRARY) { return; } std::string libflags; @@ -1992,9 +1993,9 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions( void cmVisualStudio10TargetGenerator::WriteManifestOptions( std::string const& config) { - if (this->GeneratorTarget->GetType() != cmState::EXECUTABLE && - this->GeneratorTarget->GetType() != cmState::SHARED_LIBRARY && - this->GeneratorTarget->GetType() != cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() != cmStateEnums::EXECUTABLE && + this->GeneratorTarget->GetType() != cmStateEnums::SHARED_LIBRARY && + this->GeneratorTarget->GetType() != cmStateEnums::MODULE_LIBRARY) { return; } @@ -2145,9 +2146,9 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( bool cmVisualStudio10TargetGenerator::ComputeLinkOptions() { - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE || - this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || - this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE || + this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { for (std::vector::const_iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { @@ -2178,10 +2179,10 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( std::string CONFIG = cmSystemTools::UpperCase(config); const char* linkType = "SHARED"; - if (this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) { linkType = "MODULE"; } - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { linkType = "EXE"; } std::string flags; @@ -2258,7 +2259,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( std::string targetNameFull; std::string targetNameImport; std::string targetNamePDB; - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull, targetNameImport, targetNamePDB, config.c_str()); @@ -2274,7 +2275,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( if (this->GeneratorTarget->GetPropertyAsBool("WIN32_EXECUTABLE")) { if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { if (this->ClOptions[config]->UsingUnicode()) { linkOptions.AddFlag("EntryPointSymbol", "wWinMainCRTStartup"); } else { @@ -2287,7 +2288,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( } else { if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { if (this->ClOptions[config]->UsingUnicode()) { linkOptions.AddFlag("EntryPointSymbol", "mainWCRTStartup"); } else { @@ -2325,7 +2326,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( // A Windows Runtime component uses internal .NET metadata, // so does not have an import library. if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") && - this->GeneratorTarget->GetType() != cmState::EXECUTABLE) { + this->GeneratorTarget->GetType() != cmStateEnums::EXECUTABLE) { linkOptions.AddFlag("GenerateWindowsMetadata", "true"); } else if (this->GlobalGenerator->TargetsWindowsPhone() || this->GlobalGenerator->TargetsWindowsStore()) { @@ -2356,7 +2357,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( "%(IgnoreSpecificDefaultLibraries)"); } - if ((this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || + if ((this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || this->GeneratorTarget->IsExecutableWithExports()) && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { if (this->GeneratorTarget->GetPropertyAsBool( @@ -2398,8 +2399,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( void cmVisualStudio10TargetGenerator::WriteLinkOptions( std::string const& config) { - if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY || - this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY) { + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY || + this->GeneratorTarget->GetType() > cmStateEnums::MODULE_LIBRARY) { return; } Options& linkOptions = *(this->LinkOptions[config]); @@ -2432,7 +2433,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries( this->ConvertToWindowsSlash(path); libVec.push_back(path); } else if (!l->Target || - l->Target->GetType() != cmState::INTERFACE_LIBRARY) { + l->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { libVec.push_back(l->Value); } } @@ -2496,7 +2497,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1); *this->BuildFileStream << "\n"; // output cl compile flags - if (this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { + if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) { this->WriteClOptions(*i, includes); // output rc compile flags this->WriteRCOptions(*i, includes); @@ -2513,7 +2514,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() // output manifest flags this->WriteManifestOptions(*i); if (this->NsightTegra && - this->GeneratorTarget->GetType() == cmState::EXECUTABLE && + this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE && this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { this->WriteAntBuildOptions(*i); } @@ -2525,7 +2526,7 @@ void cmVisualStudio10TargetGenerator::WriteEvents( std::string const& configName) { bool addedPrelink = false; - if ((this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || + if ((this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY || this->GeneratorTarget->IsExecutableWithExports()) && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { if (this->GeneratorTarget->GetPropertyAsBool( @@ -2592,7 +2593,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() for (OrderedTargetDependSet::const_iterator i = depends.begin(); i != depends.end(); ++i) { cmGeneratorTarget const* dt = *i; - if (dt->GetType() == cmState::INTERFACE_LIBRARY) { + if (dt->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; } // skip fortran targets as they can not be processed by MSBuild @@ -2728,7 +2729,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile() { if ((this->GlobalGenerator->TargetsWindowsStore() || this->GlobalGenerator->TargetsWindowsPhone()) && - (cmState::EXECUTABLE == this->GeneratorTarget->GetType())) { + (cmStateEnums::EXECUTABLE == this->GeneratorTarget->GetType())) { std::string pfxFile; std::vector certificates; this->GeneratorTarget->GetCertificates(certificates, ""); @@ -2853,7 +2854,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() "\n", 2); - if (this->GeneratorTarget->GetType() < cmState::UTILITY) { + if (this->GeneratorTarget->GetType() < cmStateEnums::UTILITY) { isAppContainer = true; } } else if (v == "8.1") { @@ -2865,7 +2866,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() "\n", 2); - if (this->GeneratorTarget->GetType() < cmState::UTILITY) { + if (this->GeneratorTarget->GetType() < cmStateEnums::UTILITY) { isAppContainer = true; } } else if (v == "8.0") { @@ -2878,10 +2879,11 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() 2); if (isWindowsStore && - this->GeneratorTarget->GetType() < cmState::UTILITY) { + this->GeneratorTarget->GetType() < cmStateEnums::UTILITY) { isAppContainer = true; } else if (isWindowsPhone && - this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + this->GeneratorTarget->GetType() == + cmStateEnums::EXECUTABLE) { this->WriteString("true\n", 2); this->WriteString("", 2); (*this->BuildFileStream) @@ -2931,7 +2933,7 @@ void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles() { // For Windows and Windows Phone executables, we will assume that if a // manifest is not present that we need to add all the necessary files - if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { + if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) { std::vector manifestSources; this->GeneratorTarget->GetAppManifest(manifestSources, ""); { -- cgit v0.12