Skip to content

Commit 936b7b2

Browse files
committed
[CMake] Add missing build dependency for builtin zstd
builtins/zstd defined the imported ZSTD::ZSTD target but never tied it to the BUILTIN_ZSTD ExternalProject that actually produces libzstd.a. As a result a parallel or targeted build (e.g. building only the Core target) could try to link the archive before it exists. Add the dependency edge, consistent with what builtins/zlib already does for BUILTIN_ZLIB. 🤖 Done with the help of [Claude Code](https://claude.com/claude-code) (Claude Opus 4.8)
1 parent 758c3de commit 936b7b2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

builtins/zstd/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ set_target_properties(ZSTD::ZSTD PROPERTIES
6262
IMPORTED_LOCATION ${ROOT_ZSTD_LIBRARY}
6363
INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}
6464
)
65+
# Make consumers of ZSTD::ZSTD wait for the ExternalProject that actually builds
66+
# the library, otherwise a parallel or targeted build can try to link the not-yet
67+
# existing libzstd archive (consistent with builtins/zlib's add_dependencies).
68+
add_dependencies(ZSTD::ZSTD BUILTIN_ZSTD)
6569

6670
# Set the canonical output of find_package according to
6771
# https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#standard-variable-names

0 commit comments

Comments
 (0)