File size: 585 Bytes
a7f51f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
set -e
echo "[Exocore] Checking C++ compiler..."
GPP=$(which g++ 2>/dev/null || which c++ 2>/dev/null || which clang++ 2>/dev/null || echo "")
if [ -z "$GPP" ]; then
  echo "[Exocore] No C++ compiler found. Installing g++ via nix-env..."
  nix-env -iA nixpkgs.gcc 2>/dev/null || true
  GPP=$(which g++ 2>/dev/null || echo "")
fi
if [ -z "$GPP" ]; then echo "[Exocore] ERROR: No C++ compiler available." && exit 1; fi
echo "[Exocore] C++ compiler: $GPP"

echo "[Exocore] Compiling main.cpp..."
$GPP -o main main.cpp -std=c++17
echo "[Exocore] Build successful! Run: ./main"