From 12c976a62c82ba1393964940a80b056605e69f54 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sun, 14 Jun 2026 19:28:47 -0400 Subject: [PATCH] Fix make build by depending on target name instead of TARGET_OBJECTS in custom command The Makefile generator does not create a rule for individual object files when $ is used in DEPENDS of add_custom_command. Depending on the target name instead establishes a proper target-level dependency. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd65155..6c53f00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,7 +119,7 @@ add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.o COMMAND ${LD_EXE} -r $ -o ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.o - DEPENDS $ + DEPENDS ${PROJECT_NAME}-object COMMAND_EXPAND_LISTS) add_library(${PROJECT_NAME} SHARED ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.o)