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
6db7e6d2
Commit
6db7e6d2
authored
Dec 25, 2013
by
Stephen Kelly
Browse files
add_dependencies: Disallow use with INTERFACE_LIBRARY.
parent
0bb3ca28
Changes
5
Hide whitespace changes
Inline
Side-by-side
Source/cmAddDependenciesCommand.cxx
View file @
6db7e6d2
...
...
@@ -33,6 +33,15 @@ bool cmAddDependenciesCommand
}
if
(
cmTarget
*
target
=
this
->
Makefile
->
FindTargetToUse
(
target_name
.
c_str
()))
{
if
(
target
->
GetType
()
==
cmTarget
::
INTERFACE_LIBRARY
)
{
cmOStringStream
e
;
e
<<
"Cannot add target-level dependencies to INTERFACE library "
"target
\"
"
<<
target_name
<<
"
\"
.
\n
"
;
this
->
SetError
(
e
.
str
().
c_str
());
return
false
;
}
std
::
vector
<
std
::
string
>::
const_iterator
s
=
args
.
begin
();
++
s
;
// skip over target_name
for
(;
s
!=
args
.
end
();
++
s
)
...
...
Tests/RunCMake/interface_library/RunCMakeTest.cmake
View file @
6db7e6d2
...
...
@@ -5,3 +5,4 @@ run_cmake(target_commands)
run_cmake
(
no_shared_libs
)
run_cmake
(
whitelist
)
run_cmake
(
genex_link
)
run_cmake
(
add_dependencies
)
Tests/RunCMake/interface_library/add_dependencies-result.txt
0 → 100644
View file @
6db7e6d2
1
Tests/RunCMake/interface_library/add_dependencies-stderr.txt
0 → 100644
View file @
6db7e6d2
CMake Error at add_dependencies.cmake:4 \(add_dependencies\):
add_dependencies Cannot add target-level dependencies to INTERFACE library
target "iface".
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
Tests/RunCMake/interface_library/add_dependencies.cmake
0 → 100644
View file @
6db7e6d2
add_library
(
foo empty.cpp
)
add_library
(
iface INTERFACE
)
add_dependencies
(
iface foo
)
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