<commit_before>#!/bin/bash
#
# Build libamici
#
set -eou pipefail

cmake=${CMAKE:-cmake}
make=${MAKE:-make}

script_path=$(dirname "$BASH_SOURCE")
amici_path=$(cd "$script_path/.." && pwd)
amici_build_dir="${amici_path}/build"
mkdir -p "${amici_build_dir}"
cd "${amici_build_dir}"

if [ "${TRAVIS:-}" = true ] ||
  [ "${GITHUB_ACTIONS:-}" = true ] ||
  [ "${ENABLE_AMICI_DEBUGGING:-}" = TRUE ]; then
  # Running on CI server
  build_type="Debug"
else
  build_type="RelWithDebInfo"
fi

${cmake} \
  -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" \
  -DCMAKE_BUILD_TYPE=$build_type \
  -DPython3_EXECUTABLE="$(command -v python3)" ..

# build, with or without sonarcloud wrapper
if [ "${CI_SONARCLOUD:-}" = "TRUE" ]; then
  build-wrapper-linux-x86-64 \
    --out-dir "${amici_path}/bw-output" \
    cmake --build . --parallel
elif [ "${TRAVIS:-}" = "true" ]; then
  cmake --build .
  ${make} python-sdist
else
  cmake --build . --parallel
  ${make} python-sdist
fi<commit_msg>Use -Werror only for AMICI_CXX_OPTIONS, not CMAKE_CXX_FLAGS<commit_after>#!/bin/bash
#
# Build libamici
#
set -eou pipefail

cmake=${CMAKE:-cmake}
make=${MAKE:-make}

script_path=$(dirname "$BASH_SOURCE")
amici_path=$(cd "$script_path/.." && pwd)
amici_build_dir="${amici_path}/build"
mkdir -p "${amici_build_dir}"
cd "${amici_build_dir}"

if [ "${TRAVIS:-}" = true ] ||
  [ "${GITHUB_ACTIONS:-}" = true ] ||
  [ "${ENABLE_AMICI_DEBUGGING:-}" = TRUE ]; then
  # Running on CI server
  build_type="Debug"
else
  build_type="RelWithDebInfo"
fi

${cmake} \
  -DAMICI_CXX_OPTIONS="-Wall;-Wextra;-Werror" \
  -DCMAKE_BUILD_TYPE=$build_type \
  -DPython3_EXECUTABLE="$(command -v python3)" ..

# build, with or without sonarcloud wrapper
if [ "${CI_SONARCLOUD:-}" = "TRUE" ]; then
  build-wrapper-linux-x86-64 \
    --out-dir "${amici_path}/bw-output" \
    cmake --build . --parallel
elif [ "${TRAVIS:-}" = "true" ]; then
  cmake --build .
  ${make} python-sdist
else
  cmake --build . --parallel
  ${make} python-sdist
fi
{'fraction_non_alphanumeric': 0.19637462235649547, 'fraction_numerical': 0.006042296072507553, 'mean_word_length': 3.9675, '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': '7352659', 'n_tokens_mistral': 807, 'n_tokens_neox': 782, 'n_words': 151}