Fixed bug 3882 - cmake fix for osx
authorSam Lantinga <slouken@libsdl.org>
Sun, 15 Oct 2017 21:07:01 -0700
changeset 116256a676d8b788f
parent 11623 817e632daa35
child 11626 2eaf345a2a30
Fixed bug 3882 - cmake fix for osx

Ozkan Sezer

In my cross-build environment with cmake-2.8.12.1, cmake does not add
SDL_coreaudio.m to its makefiles and the result is a failure. The fix
is simple: set the language to C for it as it is done at other places
in CMakeLists.txt.
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Fri Oct 13 19:55:07 2017 -0700
     1.2 +++ b/CMakeLists.txt	Sun Oct 15 21:07:01 2017 -0700
     1.3 @@ -1352,7 +1352,7 @@
     1.4    # !!! FIXME: we need Carbon for some very old API calls in
     1.5    # !!! FIXME:  src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
     1.6    # !!! FIXME:  how to dump those.
     1.7 -  if (APPLE AND NOT IOS)
     1.8 +  if(NOT IOS)
     1.9      set(SDL_FRAMEWORK_COCOA 1)
    1.10      set(SDL_FRAMEWORK_CARBON 1)
    1.11    endif()
    1.12 @@ -1373,6 +1373,8 @@
    1.13    if(SDL_AUDIO)
    1.14      set(SDL_AUDIO_DRIVER_COREAUDIO 1)
    1.15      file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.m)
    1.16 +    # !!! FIXME: modern CMake doesn't need "LANGUAGE C" for Objective-C.
    1.17 +    set_source_files_properties(${AUDIO_SOURCES} PROPERTIES LANGUAGE C)
    1.18      set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
    1.19      set(HAVE_SDL_AUDIO TRUE)
    1.20      set(SDL_FRAMEWORK_COREAUDIO 1)