diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-11-02 14:47:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-07 23:56:31 (GMT) |
commit | fe732264e9abb6249d1d112b24ce36b226590105 (patch) | |
tree | 97c08c00ec43b68f692d50729f536d84c7c0d13a /Tests/RunCMake/PositionIndependentCode | |
parent | d4134352abf69374fdad24d53d67734a135daaa5 (diff) | |
download | CMake-fe732264e9abb6249d1d112b24ce36b226590105.zip CMake-fe732264e9abb6249d1d112b24ce36b226590105.tar.gz CMake-fe732264e9abb6249d1d112b24ce36b226590105.tar.bz2 |
Add the INTERFACE_LIBRARY target type.
This target type only contains INTERFACE_* properties, so it can be
used as a structural node. The target-specific commands enforce
that they may only be used with the INTERFACE keyword when used
with INTERFACE_LIBRARY targets. The old-style target properties
matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for
this target type.
The name of the INTERFACE_LIBRARY must match a validity generator
expression. The validity is similar to that of an ALIAS target,
but with the additional restriction that it may not contain
double colons. Double colons will carry the meaning of IMPORTED
or ALIAS targets in CMake 2.8.13.
An ALIAS target may be created for an INTERFACE library.
At this point it can not be exported and does not appear in the
buildsystem and project files are not created for them. That may
be added as a feature in a later commit.
The generators need some changes to handle the INTERFACE_LIBRARY
targets returned by cmComputeLinkInterface::GetItems. The Ninja
generator does not use that API, so it doesn't require changes
related to that.
Diffstat (limited to 'Tests/RunCMake/PositionIndependentCode')
10 files changed, 42 insertions, 0 deletions
diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict4-result.txt b/Tests/RunCMake/PositionIndependentCode/Conflict4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict4-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Conflict4-stderr.txt new file mode 100644 index 0000000..76d5ea0 --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict4-stderr.txt @@ -0,0 +1,4 @@ +CMake Error: Property POSITION_INDEPENDENT_CODE on target "conflict" is +implied to be FALSE because it was used to determine the link libraries +already. The INTERFACE_POSITION_INDEPENDENT_CODE property on +dependency "picon" is in conflict. diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict4.cmake b/Tests/RunCMake/PositionIndependentCode/Conflict4.cmake new file mode 100644 index 0000000..ff5dfb3 --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict4.cmake @@ -0,0 +1,8 @@ + +add_library(piciface INTERFACE) + +add_library(picon INTERFACE) +set_property(TARGET picon PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON) + +add_executable(conflict "main.cpp") +target_link_libraries(conflict picon $<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:piciface>) diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict5-result.txt b/Tests/RunCMake/PositionIndependentCode/Conflict5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict5-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Conflict5-stderr.txt new file mode 100644 index 0000000..ecd0492 --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict5-stderr.txt @@ -0,0 +1,3 @@ +CMake Error: The INTERFACE_POSITION_INDEPENDENT_CODE property of "picoff" does +not agree with the value of POSITION_INDEPENDENT_CODE already determined +for "conflict". diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict5.cmake b/Tests/RunCMake/PositionIndependentCode/Conflict5.cmake new file mode 100644 index 0000000..e6055f4 --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict5.cmake @@ -0,0 +1,9 @@ + +add_library(picon INTERFACE) +set_property(TARGET picon PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON) + +add_library(picoff INTERFACE) +set_property(TARGET picoff PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE OFF) + +add_executable(conflict "main.cpp") +target_link_libraries(conflict picon picoff) diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict6-result.txt b/Tests/RunCMake/PositionIndependentCode/Conflict6-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict6-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict6-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Conflict6-stderr.txt new file mode 100644 index 0000000..0254e55 --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict6-stderr.txt @@ -0,0 +1,4 @@ +Property POSITION_INDEPENDENT_CODE on target "conflict" is +implied to be FALSE because it was used to determine the link libraries +already. The INTERFACE_POSITION_INDEPENDENT_CODE property on +dependency "picon" is in conflict. diff --git a/Tests/RunCMake/PositionIndependentCode/Conflict6.cmake b/Tests/RunCMake/PositionIndependentCode/Conflict6.cmake new file mode 100644 index 0000000..7ea7c5f --- /dev/null +++ b/Tests/RunCMake/PositionIndependentCode/Conflict6.cmake @@ -0,0 +1,8 @@ + +add_library(picoff INTERFACE) + +add_library(picon INTERFACE) +set_property(TARGET picon PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON) + +add_executable(conflict "main.cpp") +target_link_libraries(conflict picon $<$<NOT:$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>>:picoff>) diff --git a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake index 64a340c..3a2009b 100644 --- a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake +++ b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake @@ -3,3 +3,6 @@ include(RunCMake) run_cmake(Conflict1) run_cmake(Conflict2) run_cmake(Conflict3) +run_cmake(Conflict4) +run_cmake(Conflict5) +run_cmake(Conflict6) |