summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/cpp20.yml45
-rw-r--r--apps/ci/ci-conf.sh4
-rw-r--r--apps/compiler/includes/functions.sh13
-rw-r--r--conf/dist/config.sh2
4 files changed, 62 insertions, 2 deletions
diff --git a/.github/workflows/cpp20.yml b/.github/workflows/cpp20.yml
new file mode 100644
index 0000000000..e112f086af
--- /dev/null
+++ b/.github/workflows/cpp20.yml
@@ -0,0 +1,45 @@
+name: C++20
+on:
+ push:
+ branches:
+ - 'master'
+ pull_request:
+
+concurrency:
+ group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
+ cancel-in-progress: true
+
+jobs:
+ build:
+ runs-on: ubuntu-20.04
+ name: C++20
+ env:
+ COMPILER: clang
+ ENABLE_CPP_20: 1
+ if: github.repository == 'azerothcore/azerothcore-wotlk'
+ steps:
+ - uses: actions/checkout@v2
+ - name: Cache
+ uses: actions/cache@v2
+ with:
+ path: var/ccache
+ key: ccache:C++20:${{ github.ref }}:${{ github.sha }}
+ restore-keys: |
+ ccache:C++20:${{ github.ref }}
+ ccache:C++20
+ - name: Configure OS
+ run: source ./acore.sh install-deps
+ env:
+ CONTINUOUS_INTEGRATION: true
+ - name: Create conf/config.sh
+ run: source ./apps/ci/ci-conf.sh
+ - name: Import db
+ run: source ./apps/ci/ci-import-db.sh
+ - name: Build
+ run: source ./apps/ci/ci-compile.sh
+ - name: Dry run
+ run: source ./apps/ci/ci-worldserver-dry-run.sh
+ - name: Check startup errors
+ run: source ./apps/ci/ci-error-check.sh
+ - name: Run unit tests
+ run: source ./apps/ci/ci-run-unit-tests.sh
diff --git a/apps/ci/ci-conf.sh b/apps/ci/ci-conf.sh
index 775dabdacc..4f9ef6fda0 100644
--- a/apps/ci/ci-conf.sh
+++ b/apps/ci/ci-conf.sh
@@ -19,6 +19,10 @@ DB_AUTH_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
DB_WORLD_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
CONFIG_SH
+if [[ $ENABLE_CPP_20 -eq 1 ]]; then
+ echo "CUSE_CPP_20=ON" >> ./conf/config.sh
+fi
+
case $COMPILER in
# this is in order to use the "default" gcc version of the OS, without forcing a specific version
diff --git a/apps/compiler/includes/functions.sh b/apps/compiler/includes/functions.sh
index b028e56c5f..df41acf709 100644
--- a/apps/compiler/includes/functions.sh
+++ b/apps/compiler/includes/functions.sh
@@ -67,9 +67,18 @@ function comp_configure() {
cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH $DCONF -DSERVERS=$CSERVERS \
-DSCRIPTS=$CSCRIPTS \
+ -DUSE_CPP_20=$CUSE_CPP_20 \
-DBUILD_TESTING=$CBUILD_TESTING \
- -DTOOLS=$CTOOLS -DUSE_SCRIPTPCH=$CSCRIPTPCH -DUSE_COREPCH=$CCOREPCH -DWITH_COREDEBUG=$CDEBUG -DCMAKE_BUILD_TYPE=$CTYPE -DWITH_WARNINGS=$CWARNINGS \
- -DCMAKE_C_COMPILER=$CCOMPILERC -DCMAKE_CXX_COMPILER=$CCOMPILERCXX "-DDISABLED_AC_MODULES=$CDISABLED_AC_MODULES" $CCUSTOMOPTIONS
+ -DTOOLS=$CTOOLS \
+ -DUSE_SCRIPTPCH=$CSCRIPTPCH \
+ -DUSE_COREPCH=$CCOREPCH \
+ -DWITH_COREDEBUG=$CDEBUG \
+ -DCMAKE_BUILD_TYPE=$CTYPE \
+ -DWITH_WARNINGS=$CWARNINGS \
+ -DCMAKE_C_COMPILER=$CCOMPILERC \
+ -DCMAKE_CXX_COMPILER=$CCOMPILERCXX \
+ "-DDISABLED_AC_MODULES=$CDISABLED_AC_MODULES" \
+ $CCUSTOMOPTIONS
cd $CWD
diff --git a/conf/dist/config.sh b/conf/dist/config.sh
index ceeb656332..31c3648fdf 100644
--- a/conf/dist/config.sh
+++ b/conf/dist/config.sh
@@ -80,6 +80,8 @@ CTOOLS=${CTOOLS:-OFF}
# use precompiled headers ( fatest compilation but not optimized if you change headers often )
CSCRIPTPCH=${CSCRIPTPCH:-ON}
CCOREPCH=${CCOREPCH:-ON}
+# compile with C++20
+CUSE_CPP_20=${CUSE_CPP_20:-OFF}
# Skip specific modules from compilation (cmake reconfigure needed)
# use semicolon ; to separate modules