[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
This commit is contained in:
Michael Spencer 2020-02-20 15:25:36 -08:00
parent 72ce0c8073
commit d4ded05ba8
1 changed files with 3 additions and 1 deletions

View File

@ -24,9 +24,11 @@ set(LIBUNWIND_ASM_SOURCES
UnwindRegistersRestore.S
UnwindRegistersSave.S
)
if (MINGW)
if (MINGW OR APPLE)
# CMake doesn't build assembly sources for windows/gnu targets properly
# (up to current CMake, 3.16), so treat them as C files.
# Additionally, CMake ignores OSX_ARCHITECTURE for ASM files when targeting
# Apple platforms.
set_source_files_properties(${LIBUNWIND_ASM_SOURCES}
PROPERTIES
LANGUAGE C)