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.

(cherry picked from commit 3327050ca6)
This commit is contained in:
Camilla Löwy 2020-10-18 19:34:23 +02:00 committed by Camilla Löwy
parent 395ab660d5
commit baf26a6ea7
2 changed files with 4 additions and 2 deletions

View File

@ -132,6 +132,7 @@ information on what to include when reporting a bug.
(#1635) (#1635)
- [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays - [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays
could leak memory could leak memory
- [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787)
- [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636) - [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636)
- [X11] Bugfix: Xlib errors caused by other parts of the application could be - [X11] Bugfix: Xlib errors caused by other parts of the application could be
reported as GLFW errors reported as GLFW errors
@ -250,6 +251,7 @@ skills.
- Konstantin Käfer - Konstantin Käfer
- Eric Larson - Eric Larson
- Francis Lecavalier - Francis Lecavalier
- Jong Won Lee
- Robin Leffmann - Robin Leffmann
- Glenn Lewis - Glenn Lewis
- Shane Liesegang - Shane Liesegang

View File

@ -72,8 +72,8 @@ if (_GLFW_X11 OR _GLFW_WAYLAND)
endif() endif()
endif() endif()
if (APPLE) # Workaround for CMake not knowing about .m files before version 3.16
# For some reason CMake didn't know about .m until version 3.16 if ("${CMAKE_VERSION}" VERSION_LESS "3.16" AND APPLE)
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
cocoa_window.m nsgl_context.m PROPERTIES cocoa_window.m nsgl_context.m PROPERTIES
LANGUAGE C) LANGUAGE C)