From 67704d0eee756be8647165ff2c73f1dc074874a2 Mon Sep 17 00:00:00 2001 From: Craig Kolb Date: Wed, 13 Mar 2024 18:35:59 -0700 Subject: CMake fixes for MacOS (#3761) Co-authored-by: Yong He --- cmake/SlangTarget.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cmake') diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake index cb4443d0e..62c3c2a89 100644 --- a/cmake/SlangTarget.cmake +++ b/cmake/SlangTarget.cmake @@ -54,6 +54,8 @@ function(slang_add_target dir type) EXTRA_COMPILE_DEFINITIONS_PUBLIC # Targets with which to link privately LINK_WITH_PRIVATE + # Frameworks with which to link privately + LINK_WITH_FRAMEWORK # Targets whose headers we use, but don't link with INCLUDE_FROM_PRIVATE # Any include directories other targets need to use this target @@ -208,6 +210,12 @@ function(slang_add_target dir type) # target_link_libraries(${target} PRIVATE ${ARG_LINK_WITH_PRIVATE}) + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + foreach(link_framework ${ARG_LINK_WITH_FRAMEWORK}) + target_link_libraries(${target} PRIVATE "-framework ${link_framework}") + endforeach() + endif() + foreach(include_from ${ARG_INCLUDE_FROM_PRIVATE}) target_include_directories( ${target} -- cgit v1.2.3