shithub: cstory

Download patch

ref: fc874f063e22b3b2c2ddf6f12ec1fcc18e544c7c
parent: 60085502954f577067f7f9a68403841b2e5f52b8
author: Clownacy <[email protected]>
date: Thu Jan 23 15:54:33 EST 2020

Travis: Split CMake and Make

--- a/.travis.yml
+++ b/.travis.yml
@@ -48,8 +48,10 @@
     update: true
 
 env:
-    - MAKE_BUILD_TYPE=RELEASE=0 CMAKE_BUILD_TYPE=Debug
-    - MAKE_BUILD_TYPE=RELEASE=1 CMAKE_BUILD_TYPE=RelWithDebInfo
+    - BUILD_SYSTEM=make BUILD_TYPE=RELEASE=0
+    - BUILD_SYSTEM=cmake BUILD_TYPE=Debug
+    - BUILD_SYSTEM=make BUILD_TYPE=RELEASE=1
+    - BUILD_SYSTEM=cmake BUILD_TYPE=RelWithDebInfo
 
 before_install:
     # Set URL for Discord send script
@@ -63,8 +65,8 @@
     - echo $TRAVIS_OS_NAME
 
     # Display build type
-    - echo $MAKE_BUILD_TYPE
-    - echo $CMAKE_BUILD_TYPE
+    - echo $BUILD_SYSTEM
+    - echo $BUILD_TYPE
 
     # The following Homebrew packages aren't linked by default, and need to be prepended to the path explicitly.
     - if [ "$TRAVIS_OS_NAME" = "osx" ]; then
@@ -107,19 +109,25 @@
       fi
 
 before_script:
-    # Make build directory and generate CMake build files
-    - mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR}
-    - cmake .. -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DFIX_BUGS=ON -DWARNINGS=ON -DWARNINGS_ALL=ON
-    - cd ..
+    - |
+      if [ "BUILD_SYSTEM" == "cmake" ]; then
+        # Make build directory and generate CMake build files
+        mkdir -p ${CMAKE_BUILD_DIR} && cd ${CMAKE_BUILD_DIR}
+        cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFIX_BUGS=ON -DWARNINGS=ON -DWARNINGS_ALL=ON
+        cd ..
+      fi
 
 script:
-    # CMake build
-    - cd ${CMAKE_BUILD_DIR}
-    - cmake --build . --config $CMAKE_BUILD_TYPE --parallel $JOBS
-    - cd ..
-
-    # Make build
-    - make -j $JOBS FIX_BUGS=1 $MAKE_BUILD_TYPE WARNINGS=1 WARNINGS_ALL=1
+    - |
+      if [ "BUILD_SYSTEM" == "cmake" ]; then
+        # CMake build
+        cd ${CMAKE_BUILD_DIR}
+        cmake --build . --config $BUILD_TYPE --parallel $JOBS
+        cd ..
+      else
+        # Make build
+        make -j $JOBS FIX_BUGS=1 $BUILD_TYPE WARNINGS=1 WARNINGS_ALL=1
+      fi
 
 after_success:
     # Send success notification to Discord through DISCORD_WEBHOOK_URL