diff options
author | Brad King <brad.king@kitware.com> | 2018-09-06 22:22:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-10 11:51:44 (GMT) |
commit | f35be599612b788125d08a7c3e61d0fad3805bdd (patch) | |
tree | 49aa648c209a0e43674c3eba97016d1d167bb30c /Tests/ImportedSameName | |
parent | 1b57f49586afc9e8663d5e146732b1cd0597e7ef (diff) | |
download | CMake-f35be599612b788125d08a7c3e61d0fad3805bdd.zip CMake-f35be599612b788125d08a7c3e61d0fad3805bdd.tar.gz CMake-f35be599612b788125d08a7c3e61d0fad3805bdd.tar.bz2 |
Fix transitive usage requirements through same-name imported targets
If two imported targets in different directories have the same name we
should still be able to propagate transitive usage requirements from
both. Fix the DAG checker to work with target pointers instead of
target names since the pointers will not be duplicated even if the names
are.
Fixes: #18345
Diffstat (limited to 'Tests/ImportedSameName')
-rw-r--r-- | Tests/ImportedSameName/A/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/ImportedSameName/B/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/ImportedSameName/main.c | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Tests/ImportedSameName/A/CMakeLists.txt b/Tests/ImportedSameName/A/CMakeLists.txt index 9417a2c..0a31b40 100644 --- a/Tests/ImportedSameName/A/CMakeLists.txt +++ b/Tests/ImportedSameName/A/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(a STATIC a.c) +target_compile_definitions(a INTERFACE DEF_A) add_library(sameName INTERFACE IMPORTED) target_link_libraries(sameName INTERFACE a) diff --git a/Tests/ImportedSameName/B/CMakeLists.txt b/Tests/ImportedSameName/B/CMakeLists.txt index 6947fa9..d930326 100644 --- a/Tests/ImportedSameName/B/CMakeLists.txt +++ b/Tests/ImportedSameName/B/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(b STATIC b.c) +target_compile_definitions(b INTERFACE DEF_B) add_library(sameName INTERFACE IMPORTED) target_link_libraries(sameName INTERFACE b) diff --git a/Tests/ImportedSameName/main.c b/Tests/ImportedSameName/main.c index 33196b7..a0cb27f 100644 --- a/Tests/ImportedSameName/main.c +++ b/Tests/ImportedSameName/main.c @@ -1,3 +1,10 @@ +#ifndef DEF_A +# error "DEF_A not defined" +#endif +#ifndef DEF_B +# error "DEF_B not defined" +#endif + extern void a(void); extern void b(void); |