From 28225ba9289da3ddf312f23b7474ebdbe7ff5a63 Mon Sep 17 00:00:00 2001 From: Gustavo Maciel Date: Sun, 5 Mar 2023 13:58:40 -0300 Subject: [PATCH] fix: build on 3.x Sconstruct file --- SConstruct | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 4e80a30..c28c1a7 100755 --- a/SConstruct +++ b/SConstruct @@ -91,11 +91,11 @@ env.Append(CCFLAGS=[ # '-Wextra', ]) -env.Append(CCFLAGS=['-arch', env['arch'], "-isysroot", "$IOS_SDK_PATH", "-stdlib=libc++", '-isysroot', sdk_path]) +env.Append(CCFLAGS=['-arch', env['arch'], "-isysroot", "-stdlib=libc++", '-isysroot', sdk_path]) env.Append(CCFLAGS=['-DPTRCALL_ENABLED']) env.Prepend(CXXFLAGS=[ '-DNEED_LONG_INT', '-DLIBYUV_DISABLE_NEON', - '-DIOS_ENABLED', '-DUNIX_ENABLED', '-DCOREAUDIO_ENABLED' + '-DUNIX_ENABLED', '-DCOREAUDIO_ENABLED' ]) env.Append(LINKFLAGS=["-arch", env['arch'], '-isysroot', sdk_path, '-F' + sdk_path]) @@ -103,6 +103,8 @@ if env['arch'] == 'armv7': env.Prepend(CXXFLAGS=['-fno-aligned-allocation']) if env['version'] == '3.x': + env.Append(CCFLAGS=["$IPHONESDK"]) + env.Prepend(CXXFLAGS=['-DIPHONE_ENABLED']) env.Prepend(CXXFLAGS=['-DVERSION_3_X']) env.Prepend(CFLAGS=['-std=gnu11']) @@ -133,6 +135,8 @@ if env['version'] == '3.x': if env['arch'] != 'armv7': env.Prepend(CXXFLAGS=['-fomit-frame-pointer']) elif env['version'] == '4.0': + env.Append(CCFLAGS=["$IOS_SDK_PATH"]) + env.Prepend(CXXFLAGS=['-DIOS_ENABLED']) env.Prepend(CXXFLAGS=['-DVERSION_4_0']) env.Prepend(CFLAGS=['-std=gnu11']) @@ -184,7 +188,7 @@ sources.append(Glob('plugin/' + env['plugin'] + '/src/formats/*.mm')) sources.append(Glob('plugin/' + env['plugin'] + '/src/module/*.mm')) # lib.-..a -library_platform = env["arch"] + "-" + ("simulator" if env["simulator"] else "ios") +library_platform = env["arch"] + "-" + ("simulator" if env["simulator"] else ("iphone" if env['version'] == '3.x' else "ios")) library_name = env['plugin'] + "." + library_platform + "." + env["target"] + ".a" library = env.StaticLibrary(target=env['target_path'] + library_name, source=sources)