How can I change the "deployment target" settings? (SOLVED)

Hi,

I try to create a custom native extension because I would like to use a local “text to speech” mechanism on my device.
First, I target Mac device. So I start to write a native extension and I’m facing a curious behaviour. I want to use AVSpeechSynthesizer api which has been introduced in macOS 10.14. The current deployment target is macOS 10.7.0.
So, I decide to write a manifest file for the osx platform (referenced in game.project under the OSX/Info.plist settings) like this :

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>LSMinimumSystemVersion</key>
    	<string>10.14</string>
    </dict>
    </plist>

When I build, I still have the build errors :

    /tts/src/tts_darwin.mm
       	Line 10: 'AVSpeechSynthesizer' is only available on macOS 10.14 or newer [-Wunguarded-availability-new]
               @private AVSpeechSynthesizer* m_synthesizer;
                 
    /tts/src/tts_darwin.mm
    	Line 10: 'AVSpeechSynthesizer' has been marked as being introduced in macOS 10.14 here, but the deployment target is macOS 10.7.0
    @interface AVSpeechSynthesizer : NSObject

Any idea ? What’s wrong in my case ?

The problem you face is that we don’t determine the minimum version when building from your Info.plist, but the build settings we have in our engine.
The rest of the engine libraries we have are built using 10.7, and that won’t be possible to rebuild for every game.

I’m not sure what the fastest way forward for you is, but perhaps you can check and get the interface dynamically? E.g using [[UIDevice currentDevice] systemVersion].

An alternative could be to write your a library “offline”, with helper functions around that api. Then you can include that library in the extension.

Ok, I understand now.
Before making an “offline” library, I will try to use the previous api NSSpeechSynthesizer on Mac OS (I’m thinking it’s still available on mac 10.14+) and if I port my tts code to iOS, I will use AVSpeechSynthesizer.

Thank you for your advices / help ;o)

Can you do a runtime check using @available(macOS 10.14, *)? Like this:

1 Like