Skip to content

Commit 80120a6

Browse files
benlangmuirfinagolfin
authored andcommitted
[cmake] Avoid passing -mcx16 to non-x86_64 compilations
We were checking the host instead of the target compiler, causing many warnings about passing -mcx16 while building the runtime for arm.
1 parent 1316eef commit 80120a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function(_add_target_variant_c_compile_flags)
265265
# uses a spin lock for this, so to get reasonable behavior we have to
266266
# implement it ourselves using _InterlockedCompareExchange128.
267267
# clang-cl requires us to enable the `cx16` feature to use this intrinsic.
268-
if(SWIFT_HOST_VARIANT_ARCH STREQUAL x86_64)
268+
if(CFLAGS_ARCH STREQUAL x86_64)
269269
if(SWIFT_COMPILER_IS_MSVC_LIKE)
270270
list(APPEND result /clang:-mcx16)
271271
else()

0 commit comments

Comments
 (0)