@@ -178,19 +178,6 @@ if(TINT_ENABLE_BREAK_IN_DEBUGGER)
178
178
PROPERTIES COMPILE_DEFINITIONS "TINT_ENABLE_BREAK_IN_DEBUGGER=1" )
179
179
endif ()
180
180
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
-
194
181
################################################################################
195
182
# Tests
196
183
################################################################################
@@ -578,6 +565,19 @@ endfunction()
578
565
################################################################################
579
566
include ("BUILD.cmake" )
580
567
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
+
581
581
################################################################################
582
582
# Tint aliases
583
583
################################################################################
0 commit comments