Cocoa: Fix ObjC being built as C with CMake 3.19

CMake 3.19 adds -xc when the LANGUAGE file property is C, breaking our
workaround for CMake 3.15 and earlier not understanding the .m suffix.

Fixes #1787.
This commit is contained in:
Camilla Löwy
2020-10-18 19:34:23 +02:00
parent 5c928ff452
commit 3327050ca6
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ target_include_directories(glfw PRIVATE
target_link_libraries(glfw PRIVATE Threads::Threads ${glfw_LIBRARIES})
# Workaround for CMake not knowing about .m files before version 3.16
if (APPLE)
if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE)
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
cocoa_window.m nsgl_context.m PROPERTIES
LANGUAGE C)