Skip to content

Commit f115515

Browse files
authored
Workaround for building with clang-14 (#75510)
Port ee77955 to fix building with clang-14 that is used by the most recent Linux distros Fixes #75505
1 parent 79e022f commit f115515

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

eng/native/configurecompiler.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,13 @@ if (CLR_CMAKE_HOST_WIN32)
788788
endif()
789789

790790
elseif (NOT CLR_CMAKE_HOST_BROWSER)
791+
# This is a workaround for upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22995.
792+
#
793+
# In Clang.cmake, the decision to use single or double hyphen for target and gcc-toolchain
794+
# is made based on CMAKE_${LANG}_COMPILER_VERSION, but CMAKE_ASM_COMPILER_VERSION is empty
795+
# so it picks up single hyphen options, which new clang versions don't recognize.
796+
set (CMAKE_ASM_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}")
797+
791798
enable_language(ASM)
792799

793800
endif(CLR_CMAKE_HOST_WIN32)

0 commit comments

Comments
 (0)