Skip to content
Permalink
Browse files

Fixed C++ build step

  • Loading branch information
tomalakgeretkal authored and blacktm committed Dec 30, 2019
1 parent fbc37a5 commit 2f473e23b7789cc74f290b15768b75d31306e274
Showing with 9 additions and 3 deletions.
  1. +9 −3 bin/simple2d.sh
@@ -202,14 +202,20 @@ build() {
# If no input, print build usage
if [[ $1 == '' ]]; then print_usage_build; exit; fi

# If C or C++ source file given, e.g.:
# build app.c; build app.cpp
if [[ ${1: -2} == '.c' || ${1: -4} == '.cpp' ]]; then
# If C source file given, e.g.: build app.c
if [[ ${1: -2} == '.c' ]]; then
# Compile
gcc -std=c11 $1 `simple2d --libs` -o ${1%.*}
exit
fi

# If C++ source file given, e.g.: build app.cpp
if [[ ${1: -4} == '.cpp' ]]; then
# Compile
g++ -std=c++11 $1 `simple2d --libs` -o ${1%.*}
exit
fi

# Check if current directory has an Xcode project
has_xcodeproj?() {
if [[ $(ls *.xcodeproj 2>/dev/null) ]]; then

0 comments on commit 2f473e2

Please sign in to comment.
You can’t perform that action at this time.