summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2017-11-23 11:59:20 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-01 14:24:24 (GMT)
commit51249e69eaab33fe43805b9fe2262b4ddab01b56 (patch)
tree1a33d55faf49c0bd9107ea4be7ac8efa756ebea2 /Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
parente22c45d4c97c713734b8349132fa881f602f7ae3 (diff)
downloadCMake-51249e69eaab33fe43805b9fe2262b4ddab01b56.zip
CMake-51249e69eaab33fe43805b9fe2262b4ddab01b56.tar.gz
CMake-51249e69eaab33fe43805b9fe2262b4ddab01b56.tar.bz2
objlib: Allow `OBJECT` libraries to link to other libraries.
The proper way to use libraries is now through `target_link_libraries` for things such as usage requirements, compile definitions, include directories, etc. To facilitate this, allow `OBJECT` libraries to "link" to other libraries. Co-Author: Ben Boeckel <ben.boeckel@kitware.com> Issue: #14778
Diffstat (limited to 'Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake15
1 files changed, 14 insertions, 1 deletions
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index 5c9dd65..1660779 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -13,7 +13,20 @@ else()
run_cmake(Install)
endif()
run_cmake(Export)
-run_cmake(LinkObjLHS)
+
+function (run_object_lib_build name)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${name})
+ run_cmake_command(${name}-build ${CMAKE_COMMAND} --build .)
+endfunction ()
+
+run_object_lib_build(LinkObjLHSShared)
+run_object_lib_build(LinkObjLHSStatic)
+
run_cmake(LinkObjRHS1)
run_cmake(LinkObjRHS2)
run_cmake(MissingSource)