From 4515af366208e5ba6689965e3e1083fe58746fba Mon Sep 17 00:00:00 2001 From: Weaselbot Date: Sun, 21 Jun 2026 12:54:55 -0400 Subject: [PATCH] CMake: add target-level dependencies for conflict-set-object The custom command that links conflict-set.o depends on $, but that generator expression does not create a target-level dependency. With the Unix Makefiles generator, parallel builds can start building the consuming libraries before the object library's build rule is available, producing: gmake[3]: *** No rule to make target 'CMakeFiles/conflict-set-object.dir/ConflictSet.cpp.o', needed by 'conflict-set.o'. Stop. Add add_dependencies() so that conflict-set and conflict-set-static cannot build until conflict-set-object has produced its object files. Closes #47 --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f05f306..0c547d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,6 +139,7 @@ add_custom_command( COMMAND_EXPAND_LISTS) add_library(${PROJECT_NAME} SHARED ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.o) +add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-object) set_target_properties( ${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/radix_tree") @@ -155,6 +156,7 @@ if(HAS_VERSION_SCRIPT) endif() add_library(${PROJECT_NAME}-static STATIC ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.o) +add_dependencies(${PROJECT_NAME}-static ${PROJECT_NAME}-object) if(CMAKE_BUILD_TYPE STREQUAL Debug) set_target_properties(${PROJECT_NAME}-static PROPERTIES LINKER_LANGUAGE CXX) else()