summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx6
-rw-r--r--Tests/CMakeCommands/target_link_libraries/CMakeLists.txt6
2 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 22f6a03..0707c62 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -151,7 +151,8 @@ bool cmTargetLinkLibrariesCommand
else if(args[i] == "LINK_PUBLIC")
{
if(i != 1
- && this->CurrentProcessingState != ProcessingPlainPrivateInterface)
+ && this->CurrentProcessingState != ProcessingPlainPrivateInterface
+ && this->CurrentProcessingState != ProcessingPlainPublicInterface)
{
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
@@ -181,7 +182,8 @@ bool cmTargetLinkLibrariesCommand
else if(args[i] == "LINK_PRIVATE")
{
if(i != 1
- && this->CurrentProcessingState != ProcessingPlainPublicInterface)
+ && this->CurrentProcessingState != ProcessingPlainPublicInterface
+ && this->CurrentProcessingState != ProcessingPlainPrivateInterface)
{
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 06019e6..e11f980 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -32,7 +32,7 @@ generate_export_header(depA)
add_library(depB SHARED depB.cpp)
generate_export_header(depB)
-target_link_libraries(depB LINK_PRIVATE depA)
+target_link_libraries(depB LINK_PRIVATE depA LINK_PRIVATE depA)
add_library(libgenex SHARED libgenex.cpp)
generate_export_header(libgenex)
@@ -44,11 +44,11 @@ set_property(TARGET depB APPEND PROPERTY
add_library(depC SHARED depC.cpp)
generate_export_header(depC)
-target_link_libraries(depC LINK_PUBLIC depA)
+target_link_libraries(depC LINK_PUBLIC depA LINK_PUBLIC depA)
assert_property(depA LINK_INTERFACE_LIBRARIES "")
assert_property(depB LINK_INTERFACE_LIBRARIES "")
-assert_property(depC LINK_INTERFACE_LIBRARIES "depA")
+assert_property(depC LINK_INTERFACE_LIBRARIES "depA;depA")
add_executable(targetA targetA.cpp)