summaryrefslogtreecommitdiff
path: root/apps/compiler/includes/functions.sh
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2022-10-22 15:40:13 +0200
committerGitHub <noreply@github.com>2022-10-22 15:40:13 +0200
commit171df31196dc54b662ef7967d5b3d5ae3fc2eefc (patch)
tree1bb317c3b51de1b7549cdb5c1c598f2a50a5b517 /apps/compiler/includes/functions.sh
parentb35c907cde030f4ce4ee9162d016ba93f05d94ff (diff)
feat(CORE/bash): implemented acore dashboard for Windows (#13476)
+ implemented acore dashboard for windows + integrated acore dashboard for windows in our pipeline + implemented dry run for windows build + fixed permissions issue for all the operating systems + code clean
Diffstat (limited to 'apps/compiler/includes/functions.sh')
-rw-r--r--apps/compiler/includes/functions.sh75
1 files changed, 54 insertions, 21 deletions
diff --git a/apps/compiler/includes/functions.sh b/apps/compiler/includes/functions.sh
index 04467cbf07..3fa7e8a4cc 100644
--- a/apps/compiler/includes/functions.sh
+++ b/apps/compiler/includes/functions.sh
@@ -19,12 +19,7 @@ function comp_ccacheEnable() {
export CCACHE_COMPRESSLEVEL=${CCACHE_COMPRESSLEVEL:-9}
#export CCACHE_NODIRECT=true
- unamestr=$(uname)
- if [[ "$unamestr" == 'Darwin' ]]; then
- export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib"
- else
- export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
- fi
+ export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
}
function comp_ccacheClean() {
@@ -70,6 +65,19 @@ function comp_configure() {
comp_ccacheEnable
+ OSOPTIONS=""
+
+
+ echo "Platform: $OSTYPE"
+ case "$OSTYPE" in
+ darwin*)
+ OSOPTIONS=" -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib "
+ ;;
+ msys*)
+ OSOPTIONS=" -DMYSQL_INCLUDE_DIR=C:\tools\mysql\current\include -DMYSQL_LIBRARY=C:\tools\mysql\current\lib\mysqlclient.lib "
+ ;;
+ esac
+
cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH $DCONF \
-DAPPS_BUILD=$CAPPS_BUILD \
-DTOOLS_BUILD=$CTOOLS_BUILD \
@@ -82,7 +90,7 @@ function comp_configure() {
-DWITH_WARNINGS=$CWARNINGS \
-DCMAKE_C_COMPILER=$CCOMPILERC \
-DCMAKE_CXX_COMPILER=$CCOMPILERCXX \
- $CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $CCUSTOMOPTIONS
+ $CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $OSOPTIONS $CCUSTOMOPTIONS
cd $CWD
@@ -100,25 +108,50 @@ function comp_compile() {
comp_ccacheResetStats
- time make -j $MTHREADS
- make -j $MTHREADS install
+ time cmake --build . --config $CTYPE -j $MTHREADS
comp_ccacheShowStats
- cd $CWD
-
- if [[ $DOCKER = 1 ]]; then
- echo "Generating confs..."
- cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/etc/worldserver.conf"
- cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/etc/authserver.conf"
- cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/etc/dbimport.conf"
- fi
+ echo "Platform: $OSTYPE"
+ case "$OSTYPE" in
+ msys*)
+ cmake --install . --config $CTYPE
+
+ cd $CWD
+
+ echo "Done"
+ ;;
+ linux*|darwin*)
+ local confDir=${CONFDIR:-"$AC_BINPATH_FULL/../etc"}
+
+ # create the folders before installing to
+ # set the current user and permissions
+ echo "Creating $AC_BINPATH_FULL..."
+ mkdir -p "$AC_BINPATH_FULL"
+ echo "Creating $confDir..."
+ mkdir -p "$confDir"
+
+ echo "Cmake install..."
+ sudo cmake --install . --config $CTYPE
+
+ cd $CWD
+
+ if [[ $DOCKER = 1 ]]; then
+ echo "Generating confs..."
+ cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/${confDir}/worldserver.conf"
+ cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/${confDir}/authserver.conf"
+ cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/${confDir}/dbimport.conf"
+ fi
+ # set all aplications SUID bit
+ echo "Setting permissions on binary files"
+ find "$AC_BINPATH_FULL" -type f -exec sudo chown root:root -- {} +
+ find "$AC_BINPATH_FULL" -type f -exec sudo chmod u+s -- {} +
+
+ echo "Done"
+ ;;
+ esac
runHooks "ON_AFTER_BUILD"
-
- # set all aplications SUID bit
- sudo chown -R root:root "$AC_BINPATH_FULL"
- sudo chmod -R u+s "$AC_BINPATH_FULL"
}
function comp_build() {