[compiler-rt] Fix an MSVC build issue. (PR #111557)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 23:11:53 PDT 2024
================
@@ -599,27 +599,29 @@ else()
set(COMPILER_RT_LINK_OR_COPY copy)
endif()
-foreach(pat cas swp ldadd ldclr ldeor ldset)
- foreach(size 1 2 4 8 16)
- foreach(model 1 2 3 4 5)
- if(pat STREQUAL "cas" OR NOT size STREQUAL "16")
- set(source_asm "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S")
- set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S")
- add_custom_command(
- OUTPUT "${helper_asm}"
- COMMAND ${CMAKE_COMMAND} -E ${COMPILER_RT_LINK_OR_COPY} "${source_asm}" "${helper_asm}"
- DEPENDS "${source_asm}"
- )
- set_source_files_properties("${helper_asm}"
- PROPERTIES
- COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}"
- INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}"
- )
- list(APPEND aarch64_SOURCES "${helper_asm}")
- endif()
- endforeach(model)
- endforeach(size)
-endforeach(pat)
+if(COMPILER_RT_HAS_ASM_LSE)
----------------
mstorsjo wrote:
`if (NOT MSVC)` also covers builds in clang-cl mode (as the cmake `MSVC` flag primarily indicates the general command line style of the compiler - I think it also is set for the intel compiler for windows, that also uses a cl-style interface).
To properly single out MSVC as opposed to clang-cl, we'd need to check `CMAKE_C_COMPILER_ID`.
https://github.com/llvm/llvm-project/pull/111557
More information about the llvm-commits
mailing list