lean4-htt/bin/leanc.in
Leonardo de Moura 43cbd1e2a3 chore(bin/leanc.in): remove flags that do not exist on clang++ for OSX
@kha If we need these flags on Linux, we need to test which platform
is being used.
2019-03-18 08:38:50 -07:00

19 lines
821 B
Bash

#!/usr/bin/env bash
# Lean compiler
#
# A simple wrapper around a C++ compiler. Defaults to the compiler Lean was built with,
# which can be overridden with the environment variable `LEAN_CXX`. All parameters are passed
# as-is to the wrapped compiler.
#
# Interesting options:
# * `-U LEAN_MULTI_THREAD` can be used to optimize programs not making use of multi-threading
set -e
bindir=$(dirname $0)
for cxx in $LEAN_CXX @CMAKE_CXX_COMPILER@ /usr/bin/g++; do
if [ -f $cxx ] || command -v $cxx; then
export LEAN_CXX=$cxx && break
fi
done
[ -f $LEAN_CXX ] || command -v $LEAN_CXX || error "no suitable C++ compiler found!"
$LEAN_CXX -std=c++14 -D LEAN_MULTI_THREAD -pthread -fPIC "-I$bindir/../src" "$@" "-L$bindir" -ldl -lleanstatic -lleanstdlib -lgmp @LEANC_EXTRA_LIBS@ -Wno-unused-command-line-argument