Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bill Hoffman
CMake
Commits
55474e61
Commit
55474e61
authored
Oct 08, 2015
by
Stephen Kelly
Browse files
cmState: Move GetTargetTypeName from cmTarget.
parent
38df5c36
Changes
11
Hide whitespace changes
Inline
Side-by-side
Source/cmComputeTargetDepends.cxx
View file @
55474e61
...
...
@@ -554,8 +554,7 @@ cmComputeTargetDepends
// Describe the depender.
e
<<
"
\"
"
<<
depender
->
GetName
()
<<
"
\"
of type "
<<
cmTarget
::
GetTargetTypeName
(
depender
->
GetType
())
<<
"
\n
"
;
<<
cmState
::
GetTargetTypeName
(
depender
->
GetType
())
<<
"
\n
"
;
// List its dependencies that are inside the component.
EdgeList
const
&
nl
=
this
->
InitialGraph
[
i
];
...
...
Source/cmCoreTryCompile.cxx
View file @
55474e61
...
...
@@ -107,7 +107,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
this
->
Makefile
->
IssueMessage
(
cmake
::
FATAL_ERROR
,
"Only libraries may be used as try_compile or try_run IMPORTED "
"LINK_LIBRARIES. Got "
+
std
::
string
(
tgt
->
GetName
())
+
" of "
"type "
+
tgt
->
GetTargetTypeName
(
tgt
->
GetType
())
+
"."
);
"type "
+
cmState
::
GetTargetTypeName
(
tgt
->
GetType
())
+
"."
);
return
-
1
;
}
if
(
tgt
->
IsImported
())
...
...
Source/cmGeneratorTarget.cxx
View file @
55474e61
...
...
@@ -1965,7 +1965,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
std
::
string
msg
=
"cmTarget::GetCompileInfo called for "
;
msg
+=
this
->
GetName
();
msg
+=
" which has type "
;
msg
+=
cm
Target
::
GetTargetTypeName
(
this
->
GetType
());
msg
+=
cm
State
::
GetTargetTypeName
(
this
->
GetType
());
this
->
LocalGenerator
->
IssueMessage
(
cmake
::
INTERNAL_ERROR
,
msg
);
return
0
;
}
...
...
@@ -4697,7 +4697,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
std
::
string
msg
=
"cmGeneratorTarget::GetOutputInfo called for "
;
msg
+=
this
->
GetName
();
msg
+=
" which has type "
;
msg
+=
cm
Target
::
GetTargetTypeName
(
this
->
GetType
());
msg
+=
cm
State
::
GetTargetTypeName
(
this
->
GetType
());
this
->
LocalGenerator
->
IssueMessage
(
cmake
::
INTERNAL_ERROR
,
msg
);
return
0
;
}
...
...
Source/cmLocalGenerator.cxx
View file @
55474e61
...
...
@@ -760,7 +760,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
}
if
(
variable
==
"TARGET_TYPE"
)
{
return
cm
Target
::
GetTargetTypeName
(
replaceValues
.
CMTarget
->
GetType
());
return
cm
State
::
GetTargetTypeName
(
replaceValues
.
CMTarget
->
GetType
());
}
}
if
(
replaceValues
.
Output
)
...
...
@@ -2134,7 +2134,7 @@ void cmLocalGenerator
w
<<
cmPolicies
::
GetPolicyWarning
(
cmPolicies
::
CMP0063
)
<<
"
\n
"
"Target
\"
"
<<
target
->
GetName
()
<<
"
\"
of "
"type
\"
"
<<
cm
Target
::
GetTargetTypeName
(
target
->
GetType
())
<<
"
\"
"
"type
\"
"
<<
cm
State
::
GetTargetTypeName
(
target
->
GetType
())
<<
"
\"
"
"has the following visibility properties set for "
<<
lang
<<
":
\n
"
<<
warnCMP0063
<<
"For compatibility CMake is not honoring them for this target."
;
...
...
Source/cmMakefile.cxx
View file @
55474e61
...
...
@@ -1426,7 +1426,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
{
std
::
ostringstream
e
;
e
<<
"Target
\"
"
<<
lib
<<
"
\"
of type "
<<
cm
Target
::
GetTargetTypeName
(
tgt
->
GetType
())
<<
cm
State
::
GetTargetTypeName
(
tgt
->
GetType
())
<<
" may not be linked into another target. "
<<
"One may link only to STATIC or SHARED libraries, or "
<<
"to executables with the ENABLE_EXPORTS property set."
;
...
...
Source/cmNinjaNormalTargetGenerator.cxx
View file @
55474e61
...
...
@@ -103,7 +103,7 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
cmGlobalNinjaGenerator
::
WriteDivider
(
this
->
GetRulesFileStream
());
this
->
GetRulesFileStream
()
<<
"# Rules for each languages for "
<<
cm
Target
::
GetTargetTypeName
(
this
->
GetGeneratorTarget
()
->
GetType
())
<<
cm
State
::
GetTargetTypeName
(
this
->
GetGeneratorTarget
()
->
GetType
())
<<
" target "
<<
this
->
GetTargetName
()
<<
"
\n\n
"
;
...
...
@@ -156,8 +156,7 @@ cmNinjaNormalTargetGenerator
{
return
this
->
TargetLinkLanguage
+
"_"
+
cmTarget
::
GetTargetTypeName
(
this
->
GetGeneratorTarget
()
->
GetType
())
+
cmState
::
GetTargetTypeName
(
this
->
GetGeneratorTarget
()
->
GetType
())
+
"_LINKER__"
+
cmGlobalNinjaGenerator
::
EncodeRuleName
(
this
->
GetTarget
()
->
GetName
())
;
...
...
@@ -446,7 +445,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
const
cmState
::
TargetType
targetType
=
target
.
GetType
();
this
->
GetBuildFileStream
()
<<
"# Link build statements for "
<<
cm
Target
::
GetTargetTypeName
(
targetType
)
<<
cm
State
::
GetTargetTypeName
(
targetType
)
<<
" target "
<<
this
->
GetTargetName
()
<<
"
\n\n
"
;
...
...
Source/cmNinjaTargetGenerator.cxx
View file @
55474e61
...
...
@@ -480,8 +480,7 @@ cmNinjaTargetGenerator
cmGlobalNinjaGenerator
::
WriteDivider
(
this
->
GetBuildFileStream
());
this
->
GetBuildFileStream
()
<<
"# Object build statements for "
<<
cmTarget
::
GetTargetTypeName
(
this
->
GetGeneratorTarget
()
->
GetType
())
<<
cmState
::
GetTargetTypeName
(
this
->
GetGeneratorTarget
()
->
GetType
())
<<
" target "
<<
this
->
GetTargetName
()
<<
"
\n\n
"
;
...
...
Source/cmState.cxx
View file @
55474e61
...
...
@@ -101,6 +101,33 @@ cmState::~cmState()
cmDeleteAll
(
this
->
Commands
);
}
const
char
*
cmState
::
GetTargetTypeName
(
cmState
::
TargetType
targetType
)
{
switch
(
targetType
)
{
case
cmState
::
STATIC_LIBRARY
:
return
"STATIC_LIBRARY"
;
case
cmState
::
MODULE_LIBRARY
:
return
"MODULE_LIBRARY"
;
case
cmState
::
SHARED_LIBRARY
:
return
"SHARED_LIBRARY"
;
case
cmState
::
OBJECT_LIBRARY
:
return
"OBJECT_LIBRARY"
;
case
cmState
::
EXECUTABLE
:
return
"EXECUTABLE"
;
case
cmState
::
UTILITY
:
return
"UTILITY"
;
case
cmState
::
GLOBAL_TARGET
:
return
"GLOBAL_TARGET"
;
case
cmState
::
INTERFACE_LIBRARY
:
return
"INTERFACE_LIBRARY"
;
case
cmState
::
UNKNOWN_LIBRARY
:
return
"UNKNOWN_LIBRARY"
;
}
assert
(
0
&&
"Unexpected target type"
);
return
0
;
}
const
char
*
cmCacheEntryTypes
[]
=
{
"BOOL"
,
"PATH"
,
...
...
Source/cmState.h
View file @
55474e61
...
...
@@ -187,6 +187,8 @@ public:
INTERFACE_LIBRARY
,
UNKNOWN_LIBRARY
};
static
const
char
*
GetTargetTypeName
(
cmState
::
TargetType
targetType
);
Snapshot
CreateBaseSnapshot
();
Snapshot
CreateBuildsystemDirectorySnapshot
(
Snapshot
originSnapshot
,
...
...
Source/cmTarget.cxx
View file @
55474e61
...
...
@@ -33,33 +33,6 @@
#define UNORDERED_SET std::set
#endif
const
char
*
cmTarget
::
GetTargetTypeName
(
cmState
::
TargetType
targetType
)
{
switch
(
targetType
)
{
case
cmState
::
STATIC_LIBRARY
:
return
"STATIC_LIBRARY"
;
case
cmState
::
MODULE_LIBRARY
:
return
"MODULE_LIBRARY"
;
case
cmState
::
SHARED_LIBRARY
:
return
"SHARED_LIBRARY"
;
case
cmState
::
OBJECT_LIBRARY
:
return
"OBJECT_LIBRARY"
;
case
cmState
::
EXECUTABLE
:
return
"EXECUTABLE"
;
case
cmState
::
UTILITY
:
return
"UTILITY"
;
case
cmState
::
GLOBAL_TARGET
:
return
"GLOBAL_TARGET"
;
case
cmState
::
INTERFACE_LIBRARY
:
return
"INTERFACE_LIBRARY"
;
case
cmState
::
UNKNOWN_LIBRARY
:
return
"UNKNOWN_LIBRARY"
;
}
assert
(
0
&&
"Unexpected target type"
);
return
0
;
}
//----------------------------------------------------------------------------
class
cmTargetInternals
{
...
...
@@ -1892,7 +1865,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
// the type property returns what type the target is
else
if
(
prop
==
propTYPE
)
{
return
cm
Target
::
GetTargetTypeName
(
this
->
GetType
());
return
cm
State
::
GetTargetTypeName
(
this
->
GetType
());
}
else
if
(
prop
==
propINCLUDE_DIRECTORIES
)
{
...
...
Source/cmTarget.h
View file @
55474e61
...
...
@@ -77,7 +77,6 @@ class cmTarget
{
public:
cmTarget
();
static
const
char
*
GetTargetTypeName
(
cmState
::
TargetType
targetType
);
enum
CustomCommandType
{
PRE_BUILD
,
PRE_LINK
,
POST_BUILD
};
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment