mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
TargetTypes: Extract target-related types to dedicated header
Move some target related enumeration types from `cmStateTypes.h` to a new header, as these really aren't "state" types. Also, make `TargetType` a strongly-typed enumeration.
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
#include "cmGeneratorExpression.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmStateTypes.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmTarget.h"
|
||||
#include "cmTargetTypes.h"
|
||||
|
||||
bool cmAddExecutableCommand(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status)
|
||||
@@ -109,15 +109,15 @@ bool cmAddExecutableCommand(std::vector<std::string> const& args,
|
||||
return false;
|
||||
}
|
||||
cmTarget* aliasedTarget =
|
||||
mf.FindTargetToUse(aliasedName, { cmStateEnums::TargetDomain::NATIVE });
|
||||
mf.FindTargetToUse(aliasedName, { cm::TargetDomain::NATIVE });
|
||||
if (!aliasedTarget) {
|
||||
status.SetError(cmStrCat("cannot create ALIAS target \"", exename,
|
||||
"\" because target \"", aliasedName,
|
||||
"\" does not already exist."));
|
||||
return false;
|
||||
}
|
||||
cmStateEnums::TargetType type = aliasedTarget->GetType();
|
||||
if (type != cmStateEnums::EXECUTABLE) {
|
||||
cm::TargetType type = aliasedTarget->GetType();
|
||||
if (type != cm::TargetType::EXECUTABLE) {
|
||||
status.SetError(cmStrCat("cannot create ALIAS target \"", exename,
|
||||
"\" because target \"", aliasedName,
|
||||
"\" is not an executable."));
|
||||
@@ -140,7 +140,7 @@ bool cmAddExecutableCommand(std::vector<std::string> const& args,
|
||||
}
|
||||
|
||||
// Create the imported target.
|
||||
mf.AddImportedTarget(exename, cmStateEnums::EXECUTABLE, importGlobal);
|
||||
mf.AddImportedTarget(exename, cm::TargetType::EXECUTABLE, importGlobal);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user