CONFIG_NAME=ubuntu64

# CMake
SRC_DIR=.
BUILD_DIR=build_$(CONFIG_NAME)
INSTALL_DIR=install_$(CONFIG_NAME)
GENERATOR="Unix Makefiles"
FMILIB_CMAKE_CUSTOM_FLAGS=-DCMAKE_C_FLAGS= # N/A
BUILD_TYPE=Debug # We need debug symbols, otherwise memcheck will give limited information, and we don't distribute binaries regardless
CTEST_FLAGS_COMMON=--build-config $(BUILD_TYPE) --parallel $(shell nproc) --output-on-failure

# The problem with running the tests with regex flags is that they have dependencies, and this way we break it, and must partially
# specify the run order again... A better solution would be to attach the "--test-action memcheck" as a property to only some of the
# tests, but I can't find a way to do it.
#
# - 'ctest_build_all' is expected to give some memcheck warnings, but all other tests depend on it
# - we then run all the tests that are expected to pass memcheck
# - finally we run the tests that have are expected to fail memcheck, but have a dependency on one of the tests in the memcheck suite
#   to first run
TEST_COMMAND=ctest $(CTEST_FLAGS_COMMON) --tests-regex   ctest_build_all \
          && ctest $(CTEST_FLAGS_COMMON) --exclude-regex ctest_build_all --label-exclude skip_memcheck --test-action memcheck \
          && ctest $(CTEST_FLAGS_COMMON) --exclude-regex ctest_build_all --label-regex   skip_memcheck  \
          && ../Test/scripts/verify_memcheck_logs.sh Testing/Temporary

# FMILIB_...
GENERATE_DOXYGEN_DOC=0
BUILD_WITH_STATIC_RTLIB=0
BUILD_TESTS=1
TEST_LOCALE=1

# Path used in container for the mounted directories when building via docker
MOUNTED_DIR=/mnt/fmi-library
DOCKERFILE_NAME=$(CONFIG_NAME).Dockerfile
DOCKER_IMAGE_TAG=fmil_$(CONFIG_NAME):test
