summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-12-31 20:22:48 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-12-31 20:22:48 (GMT)
commit9bb153cbf15e65a559630bbd0dd43454692ea419 (patch)
tree42888b0a37c452cb7de31e0dfef6e34280d4f019 /Tests
parent61cd9298cd327d83a014db6cad2fc173698c0398 (diff)
downloadCMake-9bb153cbf15e65a559630bbd0dd43454692ea419.zip
CMake-9bb153cbf15e65a559630bbd0dd43454692ea419.tar.gz
CMake-9bb153cbf15e65a559630bbd0dd43454692ea419.tar.bz2
Test also stating and shared libraries
Diffstat (limited to 'Tests')
-rw-r--r--Tests/COnly/CMakeLists.txt3
-rw-r--r--Tests/COnly/conly.c13
-rw-r--r--Tests/COnly/libc1.c4
-rw-r--r--Tests/COnly/libc1.h1
-rw-r--r--Tests/COnly/libc2.c4
-rw-r--r--Tests/COnly/libc2.h1
6 files changed, 26 insertions, 0 deletions
diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt
index f9a6813..dd64d1e 100644
--- a/Tests/COnly/CMakeLists.txt
+++ b/Tests/COnly/CMakeLists.txt
@@ -1,3 +1,6 @@
# a simple C only test case
PROJECT (conly C)
+ADD_LIBRARY(c1 STATIC libc1.c)
+ADD_LIBRARY(c2 SHARED libc2.c)
ADD_EXECUTABLE (conly conly.c foo.c foo.h)
+TARGET_LINK_LIBRARIES(conly c1 c2)
diff --git a/Tests/COnly/conly.c b/Tests/COnly/conly.c
index 3f720ef..e8280ec 100644
--- a/Tests/COnly/conly.c
+++ b/Tests/COnly/conly.c
@@ -1,9 +1,22 @@
#include "foo.h"
+#include "libc1.h"
+#include "libc2.h"
+
#include <stdio.h>
int main ()
{
+ if ( LibC1Func() != 2.0 )
+ {
+ printf("Problem with libc1\n");
+ return 1;
+ }
+ if ( LibC2Func() != 1.0 )
+ {
+ printf("Problem with libc2\n");
+ return 1;
+ }
printf("Foo: %s\n", foo);
return 0;
}
diff --git a/Tests/COnly/libc1.c b/Tests/COnly/libc1.c
new file mode 100644
index 0000000..b01e1e1
--- /dev/null
+++ b/Tests/COnly/libc1.c
@@ -0,0 +1,4 @@
+float LibC1Func()
+{
+ return 2.0;
+}
diff --git a/Tests/COnly/libc1.h b/Tests/COnly/libc1.h
new file mode 100644
index 0000000..84c94a9
--- /dev/null
+++ b/Tests/COnly/libc1.h
@@ -0,0 +1 @@
+extern float LibC1Func();
diff --git a/Tests/COnly/libc2.c b/Tests/COnly/libc2.c
new file mode 100644
index 0000000..9a61837
--- /dev/null
+++ b/Tests/COnly/libc2.c
@@ -0,0 +1,4 @@
+float LibC2Func()
+{
+ return 1.0;
+}
diff --git a/Tests/COnly/libc2.h b/Tests/COnly/libc2.h
new file mode 100644
index 0000000..c2d47e5
--- /dev/null
+++ b/Tests/COnly/libc2.h
@@ -0,0 +1 @@
+extern float LibC2Func();