diff options
author | Brad King <brad.king@kitware.com> | 2014-11-11 17:45:54 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-11-11 17:45:54 (GMT) |
commit | 70c2432887da232d65bdc56e34ff046656e19703 (patch) | |
tree | 5f32496180943fd948259784e6b8ba9dbe4d26ad /Tests | |
parent | dd563e1eb3002578fcc28f9cc4ef9d2326043a23 (diff) | |
parent | 4db31095e5f4ce410c013e0b92bc5d1baee03934 (diff) | |
download | CMake-70c2432887da232d65bdc56e34ff046656e19703.zip CMake-70c2432887da232d65bdc56e34ff046656e19703.tar.gz CMake-70c2432887da232d65bdc56e34ff046656e19703.tar.bz2 |
Merge topic 'fix_link-line-dedup_regression'
4db31095 Fix link line order when shared libraries are de-duplicated
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Dependency/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/Dependency/Case5/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/Dependency/Case5/bar.c | 12 | ||||
-rw-r--r-- | Tests/Dependency/Case5/foo.c | 9 | ||||
-rw-r--r-- | Tests/Dependency/Case5/main.c | 7 |
5 files changed, 37 insertions, 0 deletions
diff --git a/Tests/Dependency/CMakeLists.txt b/Tests/Dependency/CMakeLists.txt index ef42048..ebc2d10 100644 --- a/Tests/Dependency/CMakeLists.txt +++ b/Tests/Dependency/CMakeLists.txt @@ -51,3 +51,4 @@ add_subdirectory(Case1) add_subdirectory(Case2) add_subdirectory(Case3) add_subdirectory(Case4) +add_subdirectory(Case5) diff --git a/Tests/Dependency/Case5/CMakeLists.txt b/Tests/Dependency/Case5/CMakeLists.txt new file mode 100644 index 0000000..e954b02 --- /dev/null +++ b/Tests/Dependency/Case5/CMakeLists.txt @@ -0,0 +1,8 @@ +project(CASE5 C) + +add_library(case5Foo SHARED foo.c) +add_library(case5Bar STATIC bar.c) +target_link_libraries(case5Bar case5Foo) + +add_executable(case5 main.c) +target_link_libraries(case5 case5Foo case5Bar) diff --git a/Tests/Dependency/Case5/bar.c b/Tests/Dependency/Case5/bar.c new file mode 100644 index 0000000..4cb1b1b --- /dev/null +++ b/Tests/Dependency/Case5/bar.c @@ -0,0 +1,12 @@ +#ifdef _WIN32 +__declspec(dllimport) +#endif +void foo(void); + +#include <stdio.h> + +void bar(void) +{ + foo(); + printf("bar()\n"); +} diff --git a/Tests/Dependency/Case5/foo.c b/Tests/Dependency/Case5/foo.c new file mode 100644 index 0000000..794833d --- /dev/null +++ b/Tests/Dependency/Case5/foo.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +#ifdef _WIN32 +__declspec(dllexport) +#endif +void foo(void) +{ + printf("foo()\n"); +} diff --git a/Tests/Dependency/Case5/main.c b/Tests/Dependency/Case5/main.c new file mode 100644 index 0000000..ae3dc95 --- /dev/null +++ b/Tests/Dependency/Case5/main.c @@ -0,0 +1,7 @@ +void bar(void); + +int main(int argc, char *argv[]) +{ + bar(); + return 0; +} |