diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-11-13 21:44:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-13 21:44:23 +0100 |
commit | ba7e00dfef30573a9bc8b25cb51a86cd1eed4042 (patch) | |
tree | b380ad5acb8ea0bda16de3fe9e90e2d93a239764 /platform | |
parent | 3c646350031d4765cf9064b426cb763ef4acb0da (diff) | |
parent | 7f3ecd4227edd4deb632eae9cbaeb5567a959a14 (diff) |
Merge pull request #12885 from rraallvv/osx_android_travis
travis: caching Android, iOS, macOS (cross-compile) (master)
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/detect.py | 11 | ||||
-rw-r--r-- | platform/iphone/detect.py | 21 | ||||
-rw-r--r-- | platform/osx/detect.py | 11 |
3 files changed, 34 insertions, 9 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index 966de832e8..a3ada5cf51 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -173,8 +173,15 @@ def configure(env): # For Clang to find NDK tools in preference of those system-wide env.PrependENVPath('PATH', tools_path) - env['CC'] = compiler_path + '/clang' - env['CXX'] = compiler_path + '/clang++' + ccache_path = os.environ.get("CCACHE") + if ccache_path == None: + env['CC'] = compiler_path + '/clang' + env['CXX'] = compiler_path + '/clang++' + else: + # there aren't any ccache wrappers available for Android, + # 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['AR'] = tools_path + "/ar" env['RANLIB'] = tools_path + "/ranlib" env['AS'] = tools_path + "/as" diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 993a93ff89..d426b478bf 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -76,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 diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 31032659b6..c24bd98bf6 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -84,8 +84,15 @@ def configure(env): else: # 64-bit, default basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-" - env['CC'] = basecmd + "cc" - env['CXX'] = basecmd + "c++" + ccache_path = os.environ.get("CCACHE") + if ccache_path == None: + env['CC'] = basecmd + "cc" + env['CXX'] = basecmd + "c++" + else: + # there aren't any ccache wrappers available for OS X cross-compile, + # to enable caching we need to prepend the path to the ccache binary + env['CC'] = ccache_path + ' ' + basecmd + "cc" + env['CXX'] = ccache_path + ' ' + basecmd + "c++" env['AR'] = basecmd + "ar" env['RANLIB'] = basecmd + "ranlib" env['AS'] = basecmd + "as" |