Browse Source

Add testing for when C sources are compiled with C++ compiler

Andy Cedilnik 23 years ago
parent
commit
e92c98f4b0
2 changed files with 12 additions and 1 deletions
  1. 1 1
      Tests/Simple/CMakeLists.txt
  2. 11 0
      Tests/Simple/simpleCLib.c

+ 1 - 1
Tests/Simple/CMakeLists.txt

@@ -1,5 +1,5 @@
 # a simple test case
 PROJECT (simple)
 ADD_EXECUTABLE (simple simple.cxx)
-ADD_LIBRARY(simpleLib STATIC simpleLib.cxx)
+ADD_LIBRARY(simpleLib STATIC simpleLib.cxx simpleCLib.c)
 TARGET_LINK_LIBRARIES(simple simpleLib)

+ 11 - 0
Tests/Simple/simpleCLib.c

@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+int FooBar()
+{
+  int class;
+  int private = 10;
+  for ( class = 0; class < private; class ++ )
+    {
+    printf("Count: %d/%d\n", class, private);
+    }
+}