diff options
Diffstat (limited to 'platform/iphone/detect.py')
-rw-r--r-- | platform/iphone/detect.py | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 00d8a59f74..4ea358f871 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -47,8 +47,8 @@ def configure(env): if (env["target"].startswith("release")): env.Append(CPPFLAGS=['-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1']) - env.Append(CPPFLAGS=['-O2', '-flto', '-ftree-vectorize', '-fomit-frame-pointer', '-ffast-math', '-funsafe-math-optimizations']) - env.Append(LINKFLAGS=['-O2', '-flto']) + env.Append(CPPFLAGS=['-O2', '-ftree-vectorize', '-fomit-frame-pointer', '-ffast-math', '-funsafe-math-optimizations']) + env.Append(LINKFLAGS=['-O2']) if env["target"] == "release_debug": env.Append(CPPFLAGS=['-DDEBUG_ENABLED']) @@ -56,6 +56,10 @@ def configure(env): elif (env["target"] == "debug"): env.Append(CPPFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-O0', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + if (env["use_lto"]): + env.Append(CPPFLAGS=['-flto']) + env.Append(LINKFLAGS=['-flto']) + ## Architecture if env["ios_sim"] or env["arch"] == "x86": # i386, simulator @@ -72,11 +76,22 @@ def configure(env): env['ENV']['PATH'] = env['IPHONEPATH'] + "/Developer/usr/bin/:" + env['ENV']['PATH'] - env['CC'] = '$IPHONEPATH/usr/bin/${ios_triple}clang' - env['CXX'] = '$IPHONEPATH/usr/bin/${ios_triple}clang++' - env['AR'] = '$IPHONEPATH/usr/bin/${ios_triple}ar' - env['RANLIB'] = '$IPHONEPATH/usr/bin/${ios_triple}ranlib' - env['S_compiler'] = '$IPHONEPATH/Developer/usr/bin/gcc' + compiler_path = '$IPHONEPATH/usr/bin/${ios_triple}' + s_compiler_path = '$IPHONEPATH/Developer/usr/bin/' + + ccache_path = os.environ.get("CCACHE") + if ccache_path == None: + env['CC'] = compiler_path + 'clang' + env['CXX'] = compiler_path + 'clang++' + env['S_compiler'] = s_compiler_path + 'gcc' + else: + # there aren't any ccache wrappers available for iOS, + # to enable caching we need to prepend the path to the ccache binary + env['CC'] = ccache_path + ' ' + compiler_path + 'clang' + env['CXX'] = ccache_path + ' ' + compiler_path + 'clang++' + env['S_compiler'] = ccache_path + ' ' + s_compiler_path + 'gcc' + env['AR'] = compiler_path + 'ar' + env['RANLIB'] = compiler_path + 'ranlib' ## Compile flags @@ -148,7 +163,7 @@ def configure(env): env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate' env.Append(CPPPATH=['#platform/iphone']) - env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DMPC_FIXED_POINT', '-DCOREAUDIO_ENABLED']) + env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DMPC_FIXED_POINT', '-DCOREAUDIO_ENABLED']) # TODO: Move that to opus module's config if 'module_opus_enabled' in env and env['module_opus_enabled']: |