diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index 9c135ef931a03b..efb66081827053 100644 --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -110,7 +110,7 @@ endfunction() function(add_asm_sources output) set(${output} ${ARGN} PARENT_SCOPE) # Xcode will try to compile asm files as C ('clang -x c'), and that will fail. - if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + if (${CMAKE_GENERATOR} STREQUAL "Xcode") enable_language(ASM) else() # Pass ASM file directly to the C++ compiler.