diff --git a/Runtimes/Core/cmake/modules/CatalystSupport.cmake b/Runtimes/Core/cmake/modules/CatalystSupport.cmake index 1ac17eb9b554..3e331b81ed9b 100644 --- a/Runtimes/Core/cmake/modules/CatalystSupport.cmake +++ b/Runtimes/Core/cmake/modules/CatalystSupport.cmake @@ -42,4 +42,12 @@ if(SwiftCore_COMPILER_VARIANT_TARGET) message(CONFIGURE_LOG "Swift target variant deployment version: ${SwiftCore_VARIANT_DEPLOYMENT_VERSION}") endif() endif() + + if(SwiftCore_EXPERIMENTAL_EMIT_VARIANT_MODULE) + check_compiler_flag(Swift "-experimental-emit-variant-module" HAVE_Swift_EMIT_VARIANT_MODULE_FLAG) + if(HAVE_Swift_EMIT_VARIANT_MODULE_FLAG) + add_compile_options( + "$<$:-experimental-emit-variant-module>") + endif() + endif() endif() diff --git a/Runtimes/Overlay/cmake/modules/CatalystSupport.cmake b/Runtimes/Overlay/cmake/modules/CatalystSupport.cmake index d9399e498c7c..69c341a1d58e 100644 --- a/Runtimes/Overlay/cmake/modules/CatalystSupport.cmake +++ b/Runtimes/Overlay/cmake/modules/CatalystSupport.cmake @@ -37,4 +37,12 @@ if(${PROJECT_NAME}_COMPILER_VARIANT_TARGET) mark_as_advanced(${PROJECT_NAME}_VARIANT_MODULE_TRIPLE) message(CONFIGURE_LOG "Swift target variant module triple: ${module_triple}") endif() + + if(${PROJECT_NAME}_EXPERIMENTAL_EMIT_VARIANT_MODULE) + check_compiler_flag(Swift "-experimental-emit-variant-module" HAVE_Swift_EMIT_VARIANT_MODULE_FLAG) + if(HAVE_Swift_EMIT_VARIANT_MODULE_FLAG) + add_compile_options( + "$<$:-experimental-emit-variant-module>") + endif() + endif() endif() diff --git a/Runtimes/Supplemental/cmake/modules/CatalystSupport.cmake b/Runtimes/Supplemental/cmake/modules/CatalystSupport.cmake index d9399e498c7c..69c341a1d58e 100644 --- a/Runtimes/Supplemental/cmake/modules/CatalystSupport.cmake +++ b/Runtimes/Supplemental/cmake/modules/CatalystSupport.cmake @@ -37,4 +37,12 @@ if(${PROJECT_NAME}_COMPILER_VARIANT_TARGET) mark_as_advanced(${PROJECT_NAME}_VARIANT_MODULE_TRIPLE) message(CONFIGURE_LOG "Swift target variant module triple: ${module_triple}") endif() + + if(${PROJECT_NAME}_EXPERIMENTAL_EMIT_VARIANT_MODULE) + check_compiler_flag(Swift "-experimental-emit-variant-module" HAVE_Swift_EMIT_VARIANT_MODULE_FLAG) + if(HAVE_Swift_EMIT_VARIANT_MODULE_FLAG) + add_compile_options( + "$<$:-experimental-emit-variant-module>") + endif() + endif() endif()