Fixed building Mac OS X opus support
authorSam Lantinga <slouken@libsdl.org>
Fri, 26 Oct 2018 11:56:10 -0700
changeset 91805c9e6169a89
parent 917 a94168f3fc7f
child 919 38d3f36bd7dd
Fixed building Mac OS X opus support
Xcode/SDL_mixer.xcodeproj/project.pbxproj
music_opus.c
     1.1 --- a/Xcode/SDL_mixer.xcodeproj/project.pbxproj	Fri Oct 26 11:49:01 2018 -0700
     1.2 +++ b/Xcode/SDL_mixer.xcodeproj/project.pbxproj	Fri Oct 26 11:56:10 2018 -0700
     1.3 @@ -9,8 +9,6 @@
     1.4  /* Begin PBXBuildFile section */
     1.5  		0448E8AE108B937A00C9D3EA /* native_midi_macosx.c in Sources */ = {isa = PBXBuildFile; fileRef = 0448E8AD108B937A00C9D3EA /* native_midi_macosx.c */; };
     1.6  		0448E8AF108B937A00C9D3EA /* native_midi_macosx.c in Sources */ = {isa = PBXBuildFile; fileRef = 0448E8AD108B937A00C9D3EA /* native_midi_macosx.c */; };
     1.7 -		630FBD7720D52063009867AB /* Opus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 630FBD7620D52063009867AB /* Opus.framework */; };
     1.8 -		630FBD7D20D5206E009867AB /* OpusFile.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 630FBD7C20D5206E009867AB /* OpusFile.framework */; };
     1.9  		630FBD8320D52105009867AB /* music_opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 630FBD8220D52105009867AB /* music_opus.c */; };
    1.10  		630FBD8520D5211F009867AB /* music_opus.h in Headers */ = {isa = PBXBuildFile; fileRef = 630FBD8420D5211F009867AB /* music_opus.h */; };
    1.11  		63CD6ADC20D52DE20096FB34 /* Opus.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 630FBD7620D52063009867AB /* Opus.framework */; };
    1.12 @@ -198,8 +196,6 @@
    1.13  				AA6442D3175B181D00A2125A /* AudioUnit.framework in Frameworks */,
    1.14  				AA6442D5175B185800A2125A /* CoreServices.framework in Frameworks */,
    1.15  				BE1FA90207AF96B2004B6283 /* SDL2.framework in Frameworks */,
    1.16 -				630FBD7720D52063009867AB /* Opus.framework in Frameworks */,
    1.17 -				630FBD7D20D5206E009867AB /* OpusFile.framework in Frameworks */,
    1.18  			);
    1.19  			runOnlyForDeploymentPostprocessing = 0;
    1.20  		};
    1.21 @@ -658,6 +654,7 @@
    1.22  					MUSIC_OGG,
    1.23  					MUSIC_FLAC,
    1.24  					MUSIC_OPUS,
    1.25 +					"OPUS_HEADER=\"<opusfile.h>\"",
    1.26  				);
    1.27  				INFOPLIST_FILE = "Info-Framework.plist";
    1.28  				INSTALL_PATH = "@rpath";
    1.29 @@ -672,6 +669,8 @@
    1.30  					mpg123,
    1.31  					"-weak_framework",
    1.32  					Vorbis,
    1.33 +					"-weak_framework",
    1.34 +					OpusFile,
    1.35  				);
    1.36  				PRODUCT_BUNDLE_IDENTIFIER = "org.libsdl.SDL2-mixer";
    1.37  				WRAPPER_EXTENSION = framework;
    1.38 @@ -700,6 +699,7 @@
    1.39  					MUSIC_OGG,
    1.40  					MUSIC_FLAC,
    1.41  					MUSIC_OPUS,
    1.42 +					"OPUS_HEADER=\"<opusfile.h>\"",
    1.43  				);
    1.44  				INFOPLIST_FILE = "Info-Framework.plist";
    1.45  				INSTALL_PATH = "@rpath";
    1.46 @@ -714,6 +714,8 @@
    1.47  					mpg123,
    1.48  					"-weak_framework",
    1.49  					Vorbis,
    1.50 +					"-weak_framework",
    1.51 +					OpusFile,
    1.52  				);
    1.53  				PRODUCT_BUNDLE_IDENTIFIER = "org.libsdl.SDL2-mixer";
    1.54  				WRAPPER_EXTENSION = framework;
     2.1 --- a/music_opus.c	Fri Oct 26 11:49:01 2018 -0700
     2.2 +++ b/music_opus.c	Fri Oct 26 11:56:10 2018 -0700
     2.3 @@ -27,7 +27,11 @@
     2.4  
     2.5  #include "music_opus.h"
     2.6  
     2.7 +#if defined(OPUS_HEADER)
     2.8 +#include OPUS_HEADER
     2.9 +#else
    2.10  #include <opus/opusfile.h>
    2.11 +#endif
    2.12  
    2.13  typedef struct {
    2.14      int loaded;
    2.15 @@ -65,7 +69,7 @@
    2.16          extern OggOpusFile *op_open_callbacks(void *,const OpusFileCallbacks *,const unsigned char *,size_t,int *) __attribute__((weak_import));
    2.17          if (op_open_callbacks == NULL) {
    2.18              /* Missing weakly linked framework */
    2.19 -            Mix_SetError("Missing Opus.framework");
    2.20 +            Mix_SetError("Missing OpusFile.framework");
    2.21              return -1;
    2.22          }
    2.23  #endif