summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCraig Kolb <craig@kolb.net>2024-03-13 18:35:59 -0700
committerGitHub <noreply@github.com>2024-03-13 18:35:59 -0700
commit67704d0eee756be8647165ff2c73f1dc074874a2 (patch)
treefecc5aa2c8dbf043cf38d236e4f1e1f15450b735 /CMakeLists.txt
parente4b01c4ba53c40ff0704e72615422e5a96f636e3 (diff)
CMake fixes for MacOS (#3761)
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62fc0868b..4b0b14d6d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,7 +96,7 @@ option(SLANG_ENABLE_TESTS "Enable test targets, requires SLANG_ENABLE_GFX, SLANG
option(SLANG_ENABLE_EXAMPLES "Enable example targets, requires SLANG_ENABLE_GFX" ON)
enum_option(
- SLANG_LIB_TYPE
+ SLANG_LIB_TYPE
# Default
SHARED
"How to build the slang lib:"
@@ -458,9 +458,10 @@ if(SLANG_ENABLE_GFX)
core
imgui
$<$<BOOL:${SLANG_ENABLE_XLIB}>:X11::X11>
- $<$<PLATFORM_ID:Darwin>:-framework Cocoa>
- $<$<PLATFORM_ID:Darwin>:-framework QuartzCore>
${CMAKE_DL_LIBS}
+ LINK_WITH_FRAMEWORK
+ Cocoa
+ QuartzCore
EXTRA_COMPILE_DEFINITIONS_PRIVATE
$<$<BOOL:${SLANG_ENABLE_XLIB}>:SLANG_ENABLE_XLIB>
INCLUDE_FROM_PRIVATE gfx
@@ -481,6 +482,9 @@ if(SLANG_ENABLE_GFX)
Vulkan-Headers
$<$<BOOL:${SLANG_ENABLE_XLIB}>:X11::X11>
$<$<BOOL:${SLANG_ENABLE_CUDA}>:CUDA::cudart;CUDA::cuda_driver>
+ LINK_WITH_FRAMEWORK
+ Cocoa
+ QuartzCore
EXTRA_COMPILE_DEFINITIONS_PRIVATE
$<$<BOOL:${SLANG_ENABLE_CUDA}>:GFX_ENABLE_CUDA>
$<$<BOOL:${SLANG_ENABLE_OPTIX}>:GFX_OPTIX>