summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/SlangTarget.cmake8
1 files changed, 8 insertions, 0 deletions
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}