From 8a4a644a6d85d601186b829d3770df681c5d48ac Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 22 May 2025 12:58:19 -0700 Subject: [PATCH] build: use library directories instead of library names `Foundation` was not being resolved to the target and instead would add `-lFoundation` to the linker invocation which is unnecessary due to the autolinking. Add the library search directory instead. --- Sources/TSCBasic/CMakeLists.txt | 4 ++-- Sources/TSCUtility/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/TSCBasic/CMakeLists.txt b/Sources/TSCBasic/CMakeLists.txt index d8b85eaa..ffefc590 100644 --- a/Sources/TSCBasic/CMakeLists.txt +++ b/Sources/TSCBasic/CMakeLists.txt @@ -59,8 +59,8 @@ target_link_libraries(TSCBasic PRIVATE TSCLibc) if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) if(Foundation_FOUND) - target_link_libraries(TSCBasic PUBLIC - Foundation) + target_link_directories(TSCBasic PUBLIC + $) endif() endif() target_link_libraries(TSCBasic PRIVATE diff --git a/Sources/TSCUtility/CMakeLists.txt b/Sources/TSCUtility/CMakeLists.txt index 8e0a232e..d6ca83d7 100644 --- a/Sources/TSCUtility/CMakeLists.txt +++ b/Sources/TSCUtility/CMakeLists.txt @@ -54,8 +54,8 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) target_link_directories(TSCUtility PRIVATE /usr/local/lib) endif() if(Foundation_FOUND) - target_link_libraries(TSCUtility PUBLIC - FoundationNetworking) + target_link_directories(TSCUtility PUBLIC + $) endif() endif() # NOTE(compnerd) workaround for CMake not setting up include flags yet