diff options
author | Brad King <brad.king@kitware.com> | 2017-02-27 14:11:20 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-02-27 14:11:20 (GMT) |
commit | 9b02283a1fdb63b0cf9755ae37a0d22fc6f4dbf4 (patch) | |
tree | 152358572a59bf65ff3c366b2a283ccaa95d1bf6 /Tests/RunCMake | |
parent | 73909e242138ba01c1ce5ebe04fa16a9a8e2e675 (diff) | |
parent | b35a949bb6ce6ae5204de2cf867dac903cb71262 (diff) | |
download | CMake-9b02283a1fdb63b0cf9755ae37a0d22fc6f4dbf4.zip CMake-9b02283a1fdb63b0cf9755ae37a0d22fc6f4dbf4.tar.gz CMake-9b02283a1fdb63b0cf9755ae37a0d22fc6f4dbf4.tar.bz2 |
Merge topic 'test-objlib-deps-cleanup'
b35a949b Tests: Change RunCMake.ObjectLibrary dependencies case to C
01347954 Tests: Fix RunCMake.ObjectLibrary dependency delay
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/Dependencies.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake | 20 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_lib.c | 7 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_lib.cpp | 7 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_main.c | 7 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_main.cpp | 7 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_obj0.c | 4 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_obj0.cpp | 4 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_obj1.c | 4 | ||||
-rw-r--r-- | Tests/RunCMake/ObjectLibrary/depends_obj1.cpp | 4 |
10 files changed, 38 insertions, 36 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 9291218..e932693 100644 --- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake +++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake @@ -24,14 +24,20 @@ function(run_Dependencies) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E copy ${RunCMake_SOURCE_DIR}/depends_obj1.cpp ${RunCMake_TEST_BINARY_DIR}/depends_obj.cpp) + if(RunCMake_GENERATOR STREQUAL "Borland Makefiles" OR + RunCMake_GENERATOR STREQUAL "Watcom WMake") + set(fs_delay 3) + else() + set(fs_delay 1.125) + endif() + + 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 .) - 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 sleep 1) - run_cmake_command(Dependencies-build ${CMAKE_COMMAND} -E touch_nocreate ${RunCMake_TEST_BINARY_DIR}/depends_obj.cpp) - run_cmake_command(Dependencies-build ${CMAKE_COMMAND} --build .) - run_cmake_command(Dependencies-build ${CMAKE_CTEST_COMMAND} -C Debug) + 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.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() run_Dependencies() 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; -} |