Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
4457a9f1
Commit
4457a9f1
authored
Oct 07, 2016
by
Stephen Kelly
Browse files
cmMakefile: Return after error and remove else condition
parent
4d039c5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/cmMakefile.cxx
View file @
4457a9f1
...
...
@@ -1226,25 +1226,26 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
e
<<
"Attempt to add link library
\"
"
<<
lib
<<
"
\"
to target
\"
"
<<
target
<<
"
\"
which is not built in this directory."
;
this
->
IssueMessage
(
cmake
::
FATAL_ERROR
,
e
.
str
());
}
else
{
cmTarget
*
tgt
=
this
->
GetGlobalGenerator
()
->
FindTarget
(
lib
);
if
(
tgt
)
{
// if it is not a static or shared library then you can not link to it
if
(
!
((
tgt
->
GetType
()
==
cmState
::
STATIC_LIBRARY
)
||
(
tgt
->
GetType
()
==
cmState
::
SHARED_LIBRARY
)
||
(
tgt
->
GetType
()
==
cmState
::
INTERFACE_LIBRARY
)
||
tgt
->
IsExecutableWithExports
()))
{
std
::
ostringstream
e
;
e
<<
"Target
\"
"
<<
lib
<<
"
\"
of type "
<<
cmState
::
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."
;
this
->
IssueMessage
(
cmake
::
FATAL_ERROR
,
e
.
str
());
}
return
;
}
cmTarget
*
tgt
=
this
->
GetGlobalGenerator
()
->
FindTarget
(
lib
);
if
(
tgt
)
{
// if it is not a static or shared library then you can not link to it
if
(
!
((
tgt
->
GetType
()
==
cmState
::
STATIC_LIBRARY
)
||
(
tgt
->
GetType
()
==
cmState
::
SHARED_LIBRARY
)
||
(
tgt
->
GetType
()
==
cmState
::
INTERFACE_LIBRARY
)
||
tgt
->
IsExecutableWithExports
()))
{
std
::
ostringstream
e
;
e
<<
"Target
\"
"
<<
lib
<<
"
\"
of type "
<<
cmState
::
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."
;
this
->
IssueMessage
(
cmake
::
FATAL_ERROR
,
e
.
str
());
}
i
->
second
.
AddLinkLibrary
(
*
this
,
target
,
lib
,
llt
);
}
i
->
second
.
AddLinkLibrary
(
*
this
,
target
,
lib
,
llt
);
}
void
cmMakefile
::
AddLinkDirectoryForTarget
(
const
std
::
string
&
target
,
...
...
Brad King
@brad.king
Mentioned in commit
1e6aaefd
·
Oct 10, 2016
Mentioned in commit
1e6aaefd
Mentioned in commit 1e6aaefdeebbf09eaf7fa0e9dbc6a7faa2f9132a
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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