mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 07:37:52 +00:00
wscript: define CUSTOM_MODES and try to link with export that only exists when CUSTOM_MODES was defined in build-time
This commit is contained in:
parent
3a8c58d192
commit
19c2061831
@ -14,7 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <opus.h>
|
||||
#define CUSTOM_MODES 1 // required to correctly link with Opus Custom
|
||||
#include <opus_custom.h>
|
||||
#include "common.h"
|
||||
#include "client.h"
|
||||
@ -47,8 +47,8 @@ Voice_CodecInfo_f
|
||||
*/
|
||||
static void Voice_CodecInfo_f( void )
|
||||
{
|
||||
int encoderComplexity;
|
||||
opus_int32 encoderBitrate;
|
||||
int encoderComplexity = 0;
|
||||
opus_int32 encoderBitrate = 0;
|
||||
|
||||
if( !voice.initialized )
|
||||
{
|
||||
|
7
wscript
7
wscript
@ -328,9 +328,14 @@ int main(int argc, char **argv) { strcasestr(argv[1], argv[2]); return 0; }'''
|
||||
|
||||
if not conf.options.BUILD_BUNDLED_DEPS:
|
||||
# check if we can use system opus
|
||||
conf.define('CUSTOM_MODES', 1)
|
||||
|
||||
# try to link with export that only exists with CUSTOM_MODES defined
|
||||
if conf.check_pkg('opus', 'opus', '''#include <opus_custom.h>
|
||||
int main(void){ return opus_custom_mode_create(44100, 1024, 0) != 0; }''', fatal = False):
|
||||
int main(void){ return !opus_custom_encoder_init(0, 0, 0); }''', fatal = False):
|
||||
conf.env.HAVE_SYSTEM_OPUS = True
|
||||
else:
|
||||
conf.undefine('CUSTOM_MODES')
|
||||
|
||||
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')
|
||||
conf.define('XASH_LOW_MEMORY', conf.options.LOW_MEMORY)
|
||||
|
Loading…
Reference in New Issue
Block a user