summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-26 15:38:39 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-26 15:43:32 (GMT)
commitb35a949bb6ce6ae5204de2cf867dac903cb71262 (patch)
tree37129876dd3c443a9068a12e34bdaa73a31ee825
parent01347954187ebccf83fc7540163f150a5f430c36 (diff)
downloadCMake-b35a949bb6ce6ae5204de2cf867dac903cb71262.zip
CMake-b35a949bb6ce6ae5204de2cf867dac903cb71262.tar.gz
CMake-b35a949bb6ce6ae5204de2cf867dac903cb71262.tar.bz2
Tests: Change RunCMake.ObjectLibrary dependencies case to C
-rw-r--r--Tests/RunCMake/ObjectLibrary/Dependencies.cmake10
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_lib.c7
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_lib.cpp7
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_main.c7
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_main.cpp7
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_obj0.c4
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_obj0.cpp4
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_obj1.c4
-rw-r--r--Tests/RunCMake/ObjectLibrary/depends_obj1.cpp4
10 files changed, 27 insertions, 31 deletions
diff --git a/Tests/RunCMake/ObjectLibrary/Dependencies.cmake b/Tests/RunCMake/ObjectLibrary/Dependencies.cmake
index 4e3db5f..6ddf545 100644
--- a/Tests/RunCMake/ObjectLibrary/Dependencies.cmake
+++ b/Tests/RunCMake/ObjectLibrary/Dependencies.cmake
@@ -1,10 +1,6 @@
-cmake_minimum_required(VERSION 3.7)
-
-project(Dependencies)
-
-add_library(myobj OBJECT ${CMAKE_BINARY_DIR}/depends_obj.cpp)
-add_library(mylib STATIC $<TARGET_OBJECTS:myobj> depends_lib.cpp)
-add_executable(myexe depends_main.cpp)
+add_library(myobj OBJECT ${CMAKE_BINARY_DIR}/depends_obj.c)
+add_library(mylib STATIC $<TARGET_OBJECTS:myobj> depends_lib.c)
+add_executable(myexe depends_main.c)
target_link_libraries(myexe mylib)
enable_testing()
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index 0ac5b8c..e932693 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -31,11 +31,11 @@ function(run_Dependencies)
set(fs_delay 1.125)
endif()
- run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E copy ${RunCMake_SOURCE_DIR}/depends_obj1.cpp ${RunCMake_TEST_BINARY_DIR}/depends_obj.cpp)
+ run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E copy ${RunCMake_SOURCE_DIR}/depends_obj1.c ${RunCMake_TEST_BINARY_DIR}/depends_obj.c)
run_cmake(Dependencies)
run_cmake_command(Dependencies-build ${CMAKE_COMMAND} --build . --config Debug)
run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E sleep ${fs_delay})
- run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E copy ${RunCMake_SOURCE_DIR}/depends_obj0.cpp ${RunCMake_TEST_BINARY_DIR}/depends_obj.cpp)
+ run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E copy ${RunCMake_SOURCE_DIR}/depends_obj0.c ${RunCMake_TEST_BINARY_DIR}/depends_obj.c)
run_cmake_command(Dependencies-build ${CMAKE_COMMAND} --build . --config Debug)
run_cmake_command(Dependencies-build ${CMAKE_CTEST_COMMAND} -C Debug -V)
endfunction()
diff --git a/Tests/RunCMake/ObjectLibrary/depends_lib.c b/Tests/RunCMake/ObjectLibrary/depends_lib.c
new file mode 100644
index 0000000..a41b32c
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/depends_lib.c
@@ -0,0 +1,7 @@
+#include <stdlib.h>
+extern int myobj_foo(void);
+
+void mylib_foo(void)
+{
+ exit(myobj_foo());
+}
diff --git a/Tests/RunCMake/ObjectLibrary/depends_lib.cpp b/Tests/RunCMake/ObjectLibrary/depends_lib.cpp
deleted file mode 100644
index 540b536..0000000
--- a/Tests/RunCMake/ObjectLibrary/depends_lib.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdlib.h>
-int myobj_foo();
-
-void mylib_foo()
-{
- exit(myobj_foo());
-}
diff --git a/Tests/RunCMake/ObjectLibrary/depends_main.c b/Tests/RunCMake/ObjectLibrary/depends_main.c
new file mode 100644
index 0000000..acc66c7
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/depends_main.c
@@ -0,0 +1,7 @@
+extern void mylib_foo(void);
+
+int main(void)
+{
+ mylib_foo();
+ return 0;
+}
diff --git a/Tests/RunCMake/ObjectLibrary/depends_main.cpp b/Tests/RunCMake/ObjectLibrary/depends_main.cpp
deleted file mode 100644
index a9d323d..0000000
--- a/Tests/RunCMake/ObjectLibrary/depends_main.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-void mylib_foo();
-
-int main()
-{
- mylib_foo();
- return 0;
-}
diff --git a/Tests/RunCMake/ObjectLibrary/depends_obj0.c b/Tests/RunCMake/ObjectLibrary/depends_obj0.c
new file mode 100644
index 0000000..649d507
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/depends_obj0.c
@@ -0,0 +1,4 @@
+int myobj_foo(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/ObjectLibrary/depends_obj0.cpp b/Tests/RunCMake/ObjectLibrary/depends_obj0.cpp
deleted file mode 100644
index 73a17e7..0000000
--- a/Tests/RunCMake/ObjectLibrary/depends_obj0.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-int myobj_foo()
-{
- return 0;
-}
diff --git a/Tests/RunCMake/ObjectLibrary/depends_obj1.c b/Tests/RunCMake/ObjectLibrary/depends_obj1.c
new file mode 100644
index 0000000..e1f9f6a
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/depends_obj1.c
@@ -0,0 +1,4 @@
+int myobj_foo(void)
+{
+ return 1;
+}
diff --git a/Tests/RunCMake/ObjectLibrary/depends_obj1.cpp b/Tests/RunCMake/ObjectLibrary/depends_obj1.cpp
deleted file mode 100644
index f62ef70..0000000
--- a/Tests/RunCMake/ObjectLibrary/depends_obj1.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-int myobj_foo()
-{
- return 1;
-}