diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-02-06 23:47:31 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-02-07 15:21:09 (GMT) |
commit | 655e98bf7149eb3757a0587409076326edeb9c04 (patch) | |
tree | 71053ab3498e53f16c5800314326f3408a6586ea /Tests | |
parent | 46e28960a58a25bbf0124b6ab95eda24cc4fe1a4 (diff) | |
download | CMake-655e98bf7149eb3757a0587409076326edeb9c04.zip CMake-655e98bf7149eb3757a0587409076326edeb9c04.tar.gz CMake-655e98bf7149eb3757a0587409076326edeb9c04.tar.bz2 |
Ensure type specific compatible interface properties do not intersect.
Before, the boolean version would always win, and the string one would
be ignored.
Diffstat (limited to 'Tests')
4 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt new file mode 100644 index 0000000..5a8f99d --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the + COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user". + This is not allowed. A property may only require compatibility in a + boolean interpretation or a string interpretation, but not both. diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake new file mode 100644 index 0000000..711368a --- /dev/null +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-Bool-Conflict.cmake @@ -0,0 +1,9 @@ + +add_library(foo UNKNOWN IMPORTED) +add_library(bar UNKNOWN IMPORTED) + +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING) +set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING) + +add_executable(user main.cpp) +target_link_libraries(user foo bar) diff --git a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake index 922ad7f..9768151 100644 --- a/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompatibleInterface/RunCMakeTest.cmake @@ -8,3 +8,4 @@ run_cmake(InterfaceString-mismatch-depends) run_cmake(InterfaceString-mismatch-depend-self) run_cmake(InterfaceString-mismatched-use) run_cmake(InterfaceString-builtin-prop) +run_cmake(InterfaceString-Bool-Conflict) |