From 0cfd8c411ff450465ad2adfca43aaeb859eee643 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 1 Sep 2009 10:38:03 -0400 Subject: Test link multiplicity This tests the LINK_INTERFACE_MULTIPLICITY property for a cycle of three static libraries that must be scanned three times to link properly. --- Tests/Dependency/Case2/CMakeLists.txt | 7 ++++--- Tests/Dependency/Case2/foo1c.c | 2 ++ Tests/Dependency/Case2/foo2c.c | 2 ++ Tests/Dependency/Case2/foo3b.c | 3 ++- Tests/Dependency/Case2/foo3c.c | 1 + 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 Tests/Dependency/Case2/foo1c.c create mode 100644 Tests/Dependency/Case2/foo2c.c create mode 100644 Tests/Dependency/Case2/foo3c.c diff --git a/Tests/Dependency/Case2/CMakeLists.txt b/Tests/Dependency/Case2/CMakeLists.txt index 18100cd..21caaad 100644 --- a/Tests/Dependency/Case2/CMakeLists.txt +++ b/Tests/Dependency/Case2/CMakeLists.txt @@ -1,11 +1,12 @@ project(CASE2 C) -add_library(case2Foo1 STATIC foo1.c foo1b.c) -add_library(case2Foo2 STATIC foo2.c foo2b.c) -add_library(case2Foo3 STATIC foo3.c foo3b.c) +add_library(case2Foo1 STATIC foo1.c foo1b.c foo1c.c) +add_library(case2Foo2 STATIC foo2.c foo2b.c foo2c.c) +add_library(case2Foo3 STATIC foo3.c foo3b.c foo3c.c) target_link_libraries(case2Foo1 case2Foo2) target_link_libraries(case2Foo2 case2Foo3) target_link_libraries(case2Foo3 case2Foo1) +set_property(TARGET case2Foo1 PROPERTY LINK_INTERFACE_MULTIPLICITY 3) add_library(case2Bar1 STATIC bar1.c) add_library(case2Bar2 STATIC bar2.c) diff --git a/Tests/Dependency/Case2/foo1c.c b/Tests/Dependency/Case2/foo1c.c new file mode 100644 index 0000000..1dcca58 --- /dev/null +++ b/Tests/Dependency/Case2/foo1c.c @@ -0,0 +1,2 @@ +extern int foo2c(void); +int foo1c(void) { return foo2c(); } diff --git a/Tests/Dependency/Case2/foo2c.c b/Tests/Dependency/Case2/foo2c.c new file mode 100644 index 0000000..dbc54de --- /dev/null +++ b/Tests/Dependency/Case2/foo2c.c @@ -0,0 +1,2 @@ +extern int foo3c(void); +int foo2c(void) { return foo3c(); } diff --git a/Tests/Dependency/Case2/foo3b.c b/Tests/Dependency/Case2/foo3b.c index 90ea2f1..ca25fd8 100644 --- a/Tests/Dependency/Case2/foo3b.c +++ b/Tests/Dependency/Case2/foo3b.c @@ -1 +1,2 @@ -int foo3b(void) { return 0; } +extern int foo1c(void); +int foo3b(void) { return foo1c(); } diff --git a/Tests/Dependency/Case2/foo3c.c b/Tests/Dependency/Case2/foo3c.c new file mode 100644 index 0000000..0ad65fe --- /dev/null +++ b/Tests/Dependency/Case2/foo3c.c @@ -0,0 +1 @@ +int foo3c(void) { return 0; } -- cgit v0.12