From 8358a5d6436f21e2c9c09b5954e05fc7e1554c68 Mon Sep 17 00:00:00 2001 From: Ben Hillis Date: Sat, 25 Apr 2026 11:19:48 -0700 Subject: [PATCH] Remove duplicate object inclusion for wslc executable wslclib is an OBJECT library. Both \$ in add_executable() and target_link_libraries(wslc wslclib) include the same object files. In CMake 3.12+, linking an OBJECT library brings both objects and transitive dependencies, making the generator expression redundant and potentially causing duplicate symbol issues. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/windows/wslc/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/windows/wslc/CMakeLists.txt b/src/windows/wslc/CMakeLists.txt index 3988c1da1..d4a4ba623 100644 --- a/src/windows/wslc/CMakeLists.txt +++ b/src/windows/wslc/CMakeLists.txt @@ -23,7 +23,9 @@ target_precompile_headers(wslclib REUSE_FROM common) set_target_properties(wslclib PROPERTIES FOLDER windows) # Create wslc.exe -add_executable(wslc $) +# N.B. Linking wslclib (OBJECT library) brings both object files and +# transitive dependencies. Do not also use $. +add_executable(wslc) target_link_libraries(wslc wslclib)