|
@@ -1,47 +1,57 @@
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
+
|
|
#
|
|
#
|
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
-#
|
|
|
|
|
|
+#
|
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
#
|
|
#
|
|
|
|
|
|
# Build
|
|
# Build
|
|
|
|
|
|
-mkdir build
|
|
|
|
-mkdir build/release
|
|
|
|
-mkdir build/debug
|
|
|
|
-
|
|
|
|
CMAKE='cmake'
|
|
CMAKE='cmake'
|
|
|
|
+BUILD='build'
|
|
|
|
+mkdir ${BUILD}
|
|
|
|
|
|
-$CMAKE -DMAKE_BUILD_TYPE=Release -S "src/external/antlr4/runtime/Cpp/" -B "build/release/external/antlr4/runtime/Cpp/"
|
|
|
|
-pushd build/release/external/antlr4/runtime/Cpp
|
|
|
|
-make -j16
|
|
|
|
-popd
|
|
|
|
-
|
|
|
|
-$CMAKE -DMAKE_BUILD_TYPE=Release -S "src/" -B "build/release"
|
|
|
|
-pushd build/release
|
|
|
|
-echo "Building release..."
|
|
|
|
-make -j16
|
|
|
|
-ls
|
|
|
|
-echo "Release version:"
|
|
|
|
-./azslc --version
|
|
|
|
-popd
|
|
|
|
-
|
|
|
|
-$CMAKE -DMAKE_BUILD_TYPE=Debug -S "src/" -B "build/debug"
|
|
|
|
-pushd build/debug
|
|
|
|
-echo "Building debug..."
|
|
|
|
-make -j16
|
|
|
|
-ls
|
|
|
|
-echo "Debug version:"
|
|
|
|
-./azslc --version
|
|
|
|
-popd
|
|
|
|
-
|
|
|
|
-# Deploy
|
|
|
|
mkdir bin
|
|
mkdir bin
|
|
-mkdir bin/linux
|
|
|
|
-mkdir bin/linux/release
|
|
|
|
-mkdir bin/linux/debug
|
|
|
|
-cp build/release/azslc bin/linux/release/azslc
|
|
|
|
-cp build/debug/azslc bin/linux/debug/azslc
|
|
|
|
|
|
+LINUX_BIN_DIR='bin/linux'
|
|
|
|
+mkdir ${LINUX_BIN_DIR}
|
|
|
|
+
|
|
|
|
+CONFIGURATIONS=("Release" "Debug")
|
|
|
|
+MY_CC="/usr/bin/gcc"
|
|
|
|
+MY_CXX="/usr/bin/g++"
|
|
|
|
+EXTRA_CXX_OPTION=""
|
|
|
|
+
|
|
|
|
+NUM_ARGS=$#
|
|
|
|
+if [ $NUM_ARGS -eq 1 ]; then
|
|
|
|
+ if [ $1 = "clang" ]; then
|
|
|
|
+ MY_CC="clang-12"
|
|
|
|
+ MY_CXX="clang++-12"
|
|
|
|
+ EXTRA_CXX_OPTION="-DWITH_LIBCXX=Off" #Required by ANTLR to avoid failure to find std c++ include files like <algorithm>, etc.
|
|
|
|
+ fi
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+for CONFIG in ${CONFIGURATIONS[@]}; do
|
|
|
|
+ echo ""
|
|
|
|
+ echo "Configuring for $CONFIG build..."
|
|
|
|
+ echo ""
|
|
|
|
+ BUILD_DIR=$BUILD/$CONFIG
|
|
|
|
+ $CMAKE -G "Unix Makefiles" -S "src/" -B $BUILD_DIR $EXTRA_CXX_OPTION -DCMAKE_BUILD_TYPE=$CONFIG -DCMAKE_C_COMPILER=$MY_CC -DCMAKE_CXX_COMPILER=$MY_CXX
|
|
|
|
+
|
|
|
|
+ echo "Will proceed to build in $CONFIG configuration..."
|
|
|
|
+ $CMAKE --build $BUILD_DIR --target azslc --config $CONFIG -j 16
|
|
|
|
+
|
|
|
|
+ pushd $BUILD_DIR
|
|
|
|
+ echo "Executing azslc in $CONFIG version:"
|
|
|
|
+ ./azslc --version
|
|
|
|
+ popd
|
|
|
|
+
|
|
|
|
+ echo "Deploying azslc $CONFIG binary..."
|
|
|
|
+ CONFIG_LCASE="$(tr [A-Z] [a-z] <<< "$CONFIG")"
|
|
|
|
+ DEPLOY_DIR=$LINUX_BIN_DIR/$CONFIG_LCASE
|
|
|
|
+ mkdir $DEPLOY_DIR
|
|
|
|
+ cp $BUILD_DIR/azslc $DEPLOY_DIR/
|
|
|
|
+ echo "azslc was deployed to $DEPLOY_DIR"
|
|
|
|
+done
|
|
|
|
+
|