<commit_before>#!/bin/bash
set -xe

ROOT_DIR=$(git rev-parse --show-toplevel)
BUILD_DIR="$ROOT_DIR/build"
GAMESERVER_DIR="$ROOT_DIR/gameserver"
DATA_DIR="$ROOT_DIR/data"


function release {
  mkdir -p "$BUILD_DIR/release"
  pushd "$BUILD_DIR/release"
  cmake "$GAMESERVER_DIR" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=release
  ln -sf "$DATA_DIR" data
  popd
}

function debug {
  mkdir -p "$BUILD_DIR/debug"
  pushd "$BUILD_DIR/debug"
  cmake "$GAMESERVER_DIR" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=debug
  ln -sf "$DATA_DIR" data
  popd
}

function debug-full {
  mkdir -p "$BUILD_DIR/debug-full"
  pushd "$BUILD_DIR/debug-full"
  cmake "$GAMESERVER_DIR" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=debug -DGAMESERVER_DEBUG_FULL=ON
  ln -sf "$DATA_DIR" data
  popd
}

function wsclient {
  mkdir -p "$BUILD_DIR/wsclient"
  pushd "$BUILD_DIR/wsclient"
  CC=emcc CXX=em++ cmake "$GAMESERVER_DIR/wsclient" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=debug
  popd
}

case $1 in
  'all')
    release
    debug
    debug-full
    wsclient
    ;;

  'release')
    release
    ;;

  'debug')
    debug
    ;;

  'debug-full')
    debug-full
    ;;

  'wsclient')
    wsclient
    ;;

  *)
    echo "Usage: $0 [all | release | debug | debug-full | wsclient]"
    ;;
esac
<commit_msg>Fix symlink issue with tools/cmake.sh<commit_after>#!/bin/bash
set -xe

ROOT_DIR=$(git rev-parse --show-toplevel)
BUILD_DIR="$ROOT_DIR/build"
GAMESERVER_DIR="$ROOT_DIR/gameserver"
DATA_DIR="$ROOT_DIR/data"


function release {
  mkdir -p "$BUILD_DIR/release"
  pushd "$BUILD_DIR/release"
  cmake "$GAMESERVER_DIR" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=release
  ln -sfn "$DATA_DIR" data
  popd
}

function debug {
  mkdir -p "$BUILD_DIR/debug"
  pushd "$BUILD_DIR/debug"
  cmake "$GAMESERVER_DIR" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=debug
  ln -sfn "$DATA_DIR" data
  popd
}

function debug-full {
  mkdir -p "$BUILD_DIR/debug-full"
  pushd "$BUILD_DIR/debug-full"
  cmake "$GAMESERVER_DIR" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=debug -DGAMESERVER_DEBUG_FULL=ON
  ln -sfn "$DATA_DIR" data
  popd
}

function wsclient {
  mkdir -p "$BUILD_DIR/wsclient"
  pushd "$BUILD_DIR/wsclient"
  CC=emcc CXX=em++ cmake "$GAMESERVER_DIR/wsclient" -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_VERSION=4.12 -DCMAKE_CXX_COMPILER_ARG1=-std=c++17 -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=FALSE -DCMAKE_BUILD_TYPE=debug
  popd
}

case $1 in
  'all')
    release
    debug
    debug-full
    wsclient
    ;;

  'release')
    release
    ;;

  'debug')
    debug
    ;;

  'debug-full')
    debug-full
    ;;

  'wsclient')
    wsclient
    ;;

  *)
    echo "Usage: $0 [all | release | debug | debug-full | wsclient]"
    ;;
esac

{'fraction_non_alphanumeric': 0.12384937238493723, 'fraction_numerical': 0.016736401673640166, 'mean_word_length': 4.344262295081967, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1822052', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1464, 'n_words': 246}