summaryrefslogtreecommitdiffstats
path: root/Tests/ObjectLibrary/CMakeLists.txt
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-07-01 14:14:27 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-01 14:14:28 (GMT)
commitac8879ce91a61703c9c3fc1e06316dbe8d5a8786 (patch)
tree9a0029af5657c8df2163082be8ad9102f1401199 /Tests/ObjectLibrary/CMakeLists.txt
parent623123aaa0dce491c3d2a365912ef8c443c8d553 (diff)
downloadCMake-ac8879ce91a61703c9c3fc1e06316dbe8d5a8786.zip
CMake-ac8879ce91a61703c9c3fc1e06316dbe8d5a8786.tar.gz
CMake-ac8879ce91a61703c9c3fc1e06316dbe8d5a8786.tar.bz2
Ninja: Add order-only dependencies to link commands (#14728)
A library or executable target that consists only of a reference to an object library may have no sources to compile or custom commands to run. The command in the target is the link (or archive) command. Add missing order-only dependencies to link commands so that target ordering dependencies are satisfied for it without depending on an intermediate compilation rule. Extend the ObjectLibrary test to cover this case. Co-Author: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Tests/ObjectLibrary/CMakeLists.txt')
-rw-r--r--Tests/ObjectLibrary/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt
index 0aeefaa..75c34d8 100644
--- a/Tests/ObjectLibrary/CMakeLists.txt
+++ b/Tests/ObjectLibrary/CMakeLists.txt
@@ -59,4 +59,10 @@ add_executable(UseABinternal ${dummy}
$<TARGET_OBJECTS:ABmain> $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>
)
+# Test target-level dependencies of executable without sources.
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/UseABinternalDep.cmake)
+add_custom_target(UseABinternalDep COMMAND ${CMAKE_COMMAND} -E touch UseABinternalDep.cmake)
+add_custom_command(TARGET UseABinternal POST_BUILD COMMAND ${CMAKE_COMMAND} -P UseABinternalDep.cmake)
+add_dependencies(UseABinternal UseABinternalDep)
+
add_subdirectory(ExportLanguages)