Skip to content

Commit 141d6d0

Browse files
KangzDawn LUCI CQ
authored andcommitted
Fix CMake compilation on macOS.
Bug: None Change-Id: Ifbb5f3a50f2e9fc9efcfcc80dd50a32c4e1941e1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/147200 Reviewed-by: Ben Clayton <[email protected]> Kokoro: Kokoro <[email protected]> Commit-Queue: Ben Clayton <[email protected]>
1 parent 3bf41f3 commit 141d6d0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/tint/CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,6 @@ if(TINT_ENABLE_BREAK_IN_DEBUGGER)
178178
PROPERTIES COMPILE_DEFINITIONS "TINT_ENABLE_BREAK_IN_DEBUGGER=1" )
179179
endif()
180180

181-
# If we're building on mac / ios and we have CoreGraphics, then we can use the
182-
# metal API to validate our shaders. This is roughly 4x faster than invoking
183-
# the metal shader compiler executable.
184-
if(APPLE)
185-
find_library(LIB_CORE_GRAPHICS CoreGraphics)
186-
if(LIB_CORE_GRAPHICS)
187-
target_sources(tint_val PRIVATE "lang/msl/validate/msl_metal.mm")
188-
target_compile_definitions(tint_val PUBLIC "-DTINT_ENABLE_MSL_VALIDATION_USING_METAL_API=1")
189-
target_compile_options(tint_val PRIVATE "-fmodules" "-fcxx-modules")
190-
target_link_options(tint_val PUBLIC "-framework" "CoreGraphics")
191-
endif()
192-
endif()
193-
194181
################################################################################
195182
# Tests
196183
################################################################################
@@ -578,6 +565,19 @@ endfunction()
578565
################################################################################
579566
include("BUILD.cmake")
580567

568+
# If we're building on mac / ios and we have CoreGraphics, then we can use the
569+
# metal API to validate our shaders. This is roughly 4x faster than invoking
570+
# the metal shader compiler executable.
571+
if(APPLE AND TINT_BUILD_MSL_WRITER)
572+
find_library(LIB_CORE_GRAPHICS CoreGraphics)
573+
if(LIB_CORE_GRAPHICS)
574+
target_sources("tint_lang_msl_validate" PRIVATE "lang/msl/validate/msl_metal.mm")
575+
target_compile_definitions("tint_lang_msl_validate" PUBLIC "-DTINT_ENABLE_MSL_VALIDATION_USING_METAL_API=1")
576+
target_compile_options("tint_lang_msl_validate" PRIVATE "-fmodules" "-fcxx-modules")
577+
target_link_options("tint_lang_msl_validate" PUBLIC "-framework" "CoreGraphics")
578+
endif()
579+
endif()
580+
581581
################################################################################
582582
# Tint aliases
583583
################################################################################

0 commit comments

Comments
 (0)