@@ -19,12 +19,19 @@ Flutter audio plugin using SoLoud library and FFI
19
19
# `../src/*` so that the C sources can be shared among all target platforms.
20
20
s . source = { :path => '.' }
21
21
s . source_files = 'Classes/**/*.{h,mm}'
22
- s . source_files = 'Classes/**/*.{h,mm}'
23
22
s . dependency 'FlutterMacOS'
24
23
s . platform = :osx , '10.15'
25
24
26
- # Check if opus and ogg libraries are available
27
- has_opus_ogg = system ( "[ -f /usr/local/lib/libogg.dylib -o -f /opt/homebrew/lib/libogg.dylib ] && [ -f /usr/local/lib/libopus.dylib -o -f /opt/homebrew/lib/libopus.dylib ]" )
25
+ # Check if all opus and ogg libraries are available (both x86_64 and arm64)
26
+ # To get these libraries, you'll need to run `brew` both in arm64 mode
27
+ # and in x86_64 mode.
28
+ # See https://github.com/alnitak/flutter_soloud/issues/191#issuecomment-2692671697
29
+ #
30
+ # This is a temporary fix just to get things building.
31
+ #
32
+ # IMPORTANT: Apps won't work correctly on user's machines unless they happen
33
+ # to have libopus and libogg installed.
34
+ has_opus_ogg = system ( "[ -f /usr/local/lib/libogg.dylib] && [ -f /opt/homebrew/lib/libogg.dylib ] && [ -f /usr/local/lib/libopus.dylib] && [ -f /opt/homebrew/lib/libopus.dylib ]" )
28
35
29
36
preprocessor_definitions = [ '$(inherited)' ]
30
37
if has_opus_ogg
@@ -43,9 +50,11 @@ Flutter audio plugin using SoLoud library and FFI
43
50
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' ,
44
51
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17" ,
45
52
"CLANG_CXX_LIBRARY" => "libc++" ,
46
- 'OTHER_LDFLAGS' => has_opus_ogg ? '-L/usr/local/lib -L/opt/homebrew/lib -logg -lopus' : '' ,
53
+ 'OTHER_LDFLAGS[arch=arm64]' => has_opus_ogg ? '-L/opt/homebrew/lib -logg -lopus' : '' ,
54
+ 'OTHER_LDFLAGS[arch=x86_64]' => has_opus_ogg ? '-L/usr/local/lib -logg -lopus' : '' ,
47
55
'OTHER_CFLAGS' => '-msse -msse2 -msse3 -msse4.1 -O3 -ffast-math -flto' ,
48
- 'OTHER_CPLUSPLUSFLAGS' => '-msse -msse2 -msse3 -msse4.1 -O3 -ffast-math -flto'
56
+ 'OTHER_CPLUSPLUSFLAGS' => '-msse -msse2 -msse3 -msse4.1 -O3 -ffast-math -flto' ,
57
+ 'VALID_ARCHS' => 'x86_64 arm64' ,
49
58
}
50
59
51
60
s . swift_version = '5.0'
0 commit comments