Skip to content

Commit d4ded05

Browse files
committed
[libunwind][CMake] Treat S files as C to work around CMake bug.
The OSX_ARCHITECTURES property is supposed to add the -arch flag when targeting Apple platforms. However, due to a bug in CMake (https://github.com/Kitware/CMake/blob/master/Source/cmLocalGenerator.cxx#L1780), this does not apply to assembly files. This results in a linker error when trying to build libunwind for i386 on MacOS. rdar://59642189
1 parent 72ce0c8 commit d4ded05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libunwind/src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ set(LIBUNWIND_ASM_SOURCES
2424
UnwindRegistersRestore.S
2525
UnwindRegistersSave.S
2626
)
27-
if (MINGW)
27+
if (MINGW OR APPLE)
2828
# CMake doesn't build assembly sources for windows/gnu targets properly
2929
# (up to current CMake, 3.16), so treat them as C files.
30+
# Additionally, CMake ignores OSX_ARCHITECTURE for ASM files when targeting
31+
# Apple platforms.
3032
set_source_files_properties(${LIBUNWIND_ASM_SOURCES}
3133
PROPERTIES
3234
LANGUAGE C)

0 commit comments

Comments
 (0)