<commit_before># Extract the current version from the VERSION file
file(STRINGS VERSION _version LIMIT_COUNT 1)

set(US_CMAKE_MINIMUM_REQUIRED_VERSION 3.2)

cmake_minimum_required(VERSION ${US_CMAKE_MINIMUM_REQUIRED_VERSION})

project(CppMicroServices VERSION ${_version})

set(US_GLOBAL_VERSION_SUFFIX ${${PROJECT_NAME}_VERSION_MAJOR})
if (${PROJECT_NAME}_VERSION_MINOR EQUAL 99)
  math(EXPR US_GLOBAL_VERSION_SUFFIX "${US_GLOBAL_VERSION_SUFFIX}+1")
endif()

string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

cmake_policy(VERSION ${US_CMAKE_MINIMUM_REQUIRED_VERSION})

list(APPEND policies_new
  CMP0025 # Compiler id for Apple Clang is now AppleClang (CMake 3.0)
  CMP0054 # Only interpret if() arguments as variables or keywords when unquoted
  )
foreach(policy ${policies_new})
  if(POLICY ${policy})
    cmake_policy(SET ${policy} NEW)
  endif()
endforeach()

#-----------------------------------------------------------------------------
# Check minimum required compiler versions
#------------------------------------------------------------------------------

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED 1)
set(CMAKE_CXX_STANDARD 11)

# We make use of the following C++11 language and library features:
#
# Language feature                 GCC   Clang   Xcode   VisualStudio
# -------------------------------------------------------------------
# Rvalue references                4.3   2.9     6       2012
# Variadic templates               4.3   2.9     6       2013*
# Initializer lists                4.4   3.1     6       2013
# Static assertions                4.3   2.9     6       2010
# auto                             4.4   2.9     6       2010
# Lambdas                          4.5   3.1     6       2012
# decltype                         4.3   2.9     6       2012<commit_msg>Fix MinGW test driver seg faults related to exception handling.<commit_after># Extract the current version from the VERSION file
file(STRINGS VERSION _version LIMIT_COUNT 1)

set(US_CMAKE_MINIMUM_REQUIRED_VERSION 3.2)

cmake_minimum_required(VERSION ${US_CMAKE_MINIMUM_REQUIRED_VERSION})

project(CppMicroServices VERSION ${_version})

set(US_GLOBAL_VERSION_SUFFIX ${${PROJECT_NAME}_VERSION_MAJOR})
if (${PROJECT_NAME}_VERSION_MINOR EQUAL 99)
  math(EXPR US_GLOBAL_VERSION_SUFFIX "${US_GLOBAL_VERSION_SUFFIX}+1")
endif()

string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

cmake_policy(VERSION ${US_CMAKE_MINIMUM_REQUIRED_VERSION})

list(APPEND policies_new
  CMP0025 # Compiler id for Apple Clang is now AppleClang (CMake 3.0)
  CMP0054 # Only interpret if() arguments as variables or keywords when unquoted
  )
foreach(policy ${policies_new})
  if(POLICY ${policy})
    cmake_policy(SET ${policy} NEW)
  endif()
endforeach()

#-----------------------------------------------------------------------------
# Check minimum required compiler versions
#------------------------------------------------------------------------------

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED 1)
set(CMAKE_CXX_STANDARD 11)

# Since version 3.1, CMake pulls in implicit link libraries when compiling
# source files in C mode. Because we mix C and C++ code in the test driver
# executable, we end up with a gcc_eh link dependency when using MinGW
# which breaks exception handling in the executable. See also:
#
# https://stackoverflow.com/questions/46688200/mixing-c-and-c-causing-exceptions-to-terminate
#
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")

# We make use of the following C++11 language and library features:
#
# Language feature                 GCC   Clang   Xcode   VisualStudio
# -------------------------------------------------------------------
# Rvalue references                4.3   2.9     6       2012
# Variadic templates               4.3   2.9     6       2013*
# Initializer lists                4.4   3.1     6       2013
# Static assertions                4.3   2.9     6       2010
# auto                             4.4   2.9     6       2010
# Lambdas                          4.5   3.1     6       2012
# decltype                         4.3   2.9     6       2012
{'fraction_non_alphanumeric': 0.1736803697397227, 'fraction_numerical': 0.04329846752614935, 'mean_word_length': 1.9287749287749287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5652088', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1194, 'n_words': 330}