Ver Fonte

Merge pull request #11245 from akien-mga/travis-ccache

Travis: Try enabling ccache to speed up builds
Rémi Verschelde há 8 anos atrás
pai
commit
9ac940677c
2 ficheiros alterados com 13 adições e 9 exclusões
  1. 7 6
      .travis.yml
  2. 6 3
      platform/windows/detect.py

+ 7 - 6
.travis.yml

@@ -4,6 +4,8 @@ dist: trusty
 
 sudo: false
 
+cache: ccache
+
 compiler:
   - gcc
   - clang
@@ -76,7 +78,10 @@ addons:
       - clang-format-3.9
 
 before_script:
-  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install scons; fi
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then
+      brew update; brew install scons ccache;
+      export PATH="/usr/local/opt/ccache/libexec:$PATH";
+    fi
   - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then
       brew update; brew install -v android-sdk;
       brew install -v android-ndk | grep -v "inflating:" | grep -v "creating:";
@@ -87,9 +92,5 @@ script:
   - if [ "$STATIC_CHECKS" = "yes" ]; then
       sh ./misc/travis/clang-format.sh;
     else
-      if [ "$TRAVIS_OS_NAME" = "windows" ]; then
-        scons -j 2 platform=$GODOT_TARGET progress=no verbose=yes CXX=$CXX openssl=builtin;
-      else
-        scons -j 2 platform=$GODOT_TARGET progress=no verbose=yes bits=64 CXX=$CXX openssl=builtin;
-      fi
+      scons -j 2 platform=$GODOT_TARGET progress=no verbose=yes CXX=$CXX builtin_openssl=yes;
     fi

+ 6 - 3
platform/windows/detect.py

@@ -226,10 +226,13 @@ def configure(env):
         else:
             env["PROGSUFFIX"] = env["PROGSUFFIX"] + ".exe"  # for linux cross-compilation
 
-        mingw_prefix = ""
-
         if (env["bits"] == "default"):
-            env["bits"] = "64" if "PROGRAMFILES(X86)" in os.environ else "32"
+            if (os.name == "nt"):
+                env["bits"] = "64" if "PROGRAMFILES(X86)" in os.environ else "32"
+            else: # default to 64-bit on Linux
+                env["bits"] = "64"
+
+        mingw_prefix = ""
 
         if (env["bits"] == "32"):
             env.Append(LINKFLAGS=['-static'])