about summary refs log tree commit diff stats
path: root/build2
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-07-25 13:40:42 -0700
committerKartik Agaram <vc@akkartik.com>2019-07-25 13:59:17 -0700
commitecbdc925d43f489e5c5b101900db88f9d260efe7 (patch)
tree626f31eebe26ccdc527c5d999ac87375e472bb88 /build2
parent34e1828162deec95b1913b420e7aee605d68fa82 (diff)
downloadmu-ecbdc925d43f489e5c5b101900db88f9d260efe7.tar.gz
5476
Fix CI. Also kill compiler version mismatch bugs once and for all.
Diffstat (limited to 'build2')
-rwxr-xr-xbuild211
1 files changed, 6 insertions, 5 deletions
diff --git a/build2 b/build2
index 293436ee..9b24bc81 100755
--- a/build2
+++ b/build2
@@ -14,6 +14,7 @@ test "$CXX" || export CXX=c++
 test "$CC" || export CC=cc
 test "$CFLAGS" || export CFLAGS="-g -O2"
 export CFLAGS="$CFLAGS -Wall -Wextra -ftrapv -fno-strict-aliasing"
+export CXXFLAGS="-std=c++98 $CFLAGS"  # CI has an ancient version; don't expect recent dialects
 
 # Outline:
 # [0-9]*.cc -> mu.cc -> .build/*.cc -> .build/*.o -> .build/mu_bin
@@ -81,7 +82,7 @@ noisy_cd() {
 }
 
 older_than enumerate/enumerate enumerate/enumerate.cc && {
-  $CXX $CFLAGS enumerate/enumerate.cc -o enumerate/enumerate
+  $CXX $CXXFLAGS enumerate/enumerate.cc -o enumerate/enumerate
 }
 
 older_than tangle/tangle tangle/*.cc && {
@@ -103,7 +104,7 @@ older_than tangle/tangle tangle/*.cc && {
     grep -h "^\s*void test_" [0-9]*.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  |update test_name_list
     # }
     # Now that we have all the _lists, compile 'tangle'
-    $CXX $CFLAGS boot.cc -o tangle
+    $CXX $CXXFLAGS boot.cc -o tangle
     ./tangle test
   noisy_cd ..  # no effect; just to show us returning to the parent directory
 }
@@ -115,7 +116,7 @@ older_than mu.cc $LAYERS enumerate/enumerate tangle/tangle && {
 }
 
 older_than cleave/cleave cleave/cleave.cc && {
-  $CXX $CFLAGS cleave/cleave.cc -o cleave/cleave
+  $CXX $CXXFLAGS cleave/cleave.cc -o cleave/cleave
   rm -rf .build
 }
 
@@ -139,7 +140,7 @@ older_than mu_bin mu.cc *_list cleave/cleave termbox/* && {
     for f in mu_*.cc
     do
       older_than `echo $f  |sed 's/\.cc$/.o/'` $f header global_declarations_list function_list test_list && {
-        $CXX $CFLAGS -c $f
+        $CXX $CXXFLAGS -c $f
       }
     done
   noisy_cd ../termbox
@@ -153,7 +154,7 @@ older_than mu_bin mu.cc *_list cleave/cleave termbox/* && {
       ar rcs libtermbox.a *.o
     }
   noisy_cd ..
-  $CXX $CFLAGS .build/*.o termbox/libtermbox.a -o .build/mu_bin
+  $CXX $CXXFLAGS .build/*.o termbox/libtermbox.a -o .build/mu_bin
   cp .build/mu_bin .
 }