fpp/compiler/scripts/fprime-gcc
Rob Bocchino 2bbfa359ed Revise component code gen
Remove conversion warnings
2025-02-19 19:16:52 -08:00

47 lines
1008 B
Bash
Executable File

#!/bin/sh -e
# ======================================================================
# Compile F Prime source files
# ----------------------------------------------------------------------
# Setup:
#
# 1. Set FPRIME to point to the root of your F Prime working repo
#
# ======================================================================
if test -z "$FPRIME"
then
echo 'fprime-gcc: environment variable FPRIME is not set' 1>&2
echo ' set FPRIME to the root of your F Prime working repo' 1>&2
exit 1
fi
flags="
-Wall
-Wconversion
-Wdouble-promotion
-Werror
-Wextra
-Wold-style-cast
-Wshadow
-pedantic
"
unset os_flags
os=`uname`
case "$os" in
Darwin)
os_type=DARWIN
os_flags='-Wno-nullability-completeness -ferror-limit=1'
;;
Linux)
os_type=LINUX
;;
*)
echo "fprime-gcc: unsupported OS $os" 1>&2
exit 1
;;
esac
g++ --std=c++11 $flags $os_flags -DTGT_OS_TYPE_$os_type -I $FPRIME -I $FPRIME/config -I $FPRIME/cmake/platform/types -I . $FPRIME_GCC_FLAGS $@