<commit_before>project(CppUTest)

set(CppUTest_version_major 3)
set(CppUTest_version_minor 8)

# 2.6.3 is needed for ctest support
# 3.1 is needed for target_sources
cmake_minimum_required(VERSION 3.1)

# Check for functions before setting a lot of stuff
include(CheckFunctionExists)
set (CMAKE_REQUIRED_INCLUDES "unistd.h")
check_function_exists(fork HAVE_FORK)
if(HAVE_FORK)
  add_definitions(-DCPPUTEST_HAVE_FORK)
endif(HAVE_FORK)

check_function_exists(strdup HAVE_STRDUP)
if(HAVE_STRDUP)
  add_definitions(-DCPPUTEST_HAVE_STRDUP=1)
endif(HAVE_STRDUP)

if (MINGW)
    # Apply workaround for MinGW timespec redefinition (pthread.h / time.h)
    include(CheckStructHasMember)
    check_struct_has_member("struct timespec" tv_sec time.h HAVE_STRUCT_TIMESPEC)
    if (HAVE_STRUCT_TIMESPEC)
        add_definitions(-D_TIMESPEC_DEFINED=1)
    endif()

    # Apply workaround for static/shared libraries on MinGW C/C++ compiler
    # Issue occurs with CMake >= 3.9.0, it doesn't filter out gcc,gcc_s,gcc_eh from
    # the implicit library list anymore, so the C++ linker is getting passed the static
    # gcc_eh library since that's what the C linker uses by default. Only solution appears
    # to be to force static linkage.
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif()

option(STD_C "Use the standard C library" ON)
option(STD_CPP "Use the standard C++ library" ON)
option(CPPUTEST_FLAGS "Use the CFLAGS/CXXFLAGS/LDFLAGS set by CppUTest" ON)
option(MEMORY_LEAK_DETECTION "Enable memory leak detection" ON)
option(EXTENSIONS "Use the CppUTest extenstion library" ON)
option(LONGLONG "Support long long" OFF)
option(MAP_FILE "Enable the creation of a map file" OFF)
option(COVERAGE "Enable running with coverage" OFF)
option(C++11 "Compile with C++11 support" OFF)
option(WERROR "Compile with warnings as errors" OFF)
<commit_msg>Fixes compiling with Clang + MinGW bintools in Windows<commit_after>project(CppUTest)

set(CppUTest_version_major 3)
set(CppUTest_version_minor 8)

# 2.6.3 is needed for ctest support
# 3.1 is needed for target_sources
cmake_minimum_required(VERSION 3.1)

# Check for functions before setting a lot of stuff
include(CheckFunctionExists)
set (CMAKE_REQUIRED_INCLUDES "unistd.h")
check_function_exists(fork HAVE_FORK)
if(HAVE_FORK)
  add_definitions(-DCPPUTEST_HAVE_FORK)
endif(HAVE_FORK)

check_function_exists(strdup HAVE_STRDUP)
if(HAVE_STRDUP)
  add_definitions(-DCPPUTEST_HAVE_STRDUP=1)
endif(HAVE_STRDUP)

if (MINGW)
    # Apply workaround for MinGW timespec redefinition (pthread.h / time.h)
    include(CheckStructHasMember)
    check_struct_has_member("struct timespec" tv_sec time.h HAVE_STRUCT_TIMESPEC)
    if (HAVE_STRUCT_TIMESPEC)
        add_definitions(-D_TIMESPEC_DEFINED=1)
    endif()

    if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
        # Apply workaround for static/shared libraries on MinGW C/C++ compiler
        # Issue occurs with CMake >= 3.9.0, it doesn't filter out gcc,gcc_s,gcc_eh from
        # the implicit library list anymore, so the C++ linker is getting passed the static
        # gcc_eh library since that's what the C linker uses by default. Only solution appears
        # to be to force static linkage.
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
    endif()
endif()

option(STD_C "Use the standard C library" ON)
option(STD_CPP "Use the standard C++ library" ON)
option(CPPUTEST_FLAGS "Use the CFLAGS/CXXFLAGS/LDFLAGS set by CppUTest" ON)
option(MEMORY_LEAK_DETECTION "Enable memory leak detection" ON)
option(EXTENSIONS "Use the CppUTest extenstion library" ON)
option(LONGLONG "Support long long" OFF)
option(MAP_FILE "Enable the creation of a map file" OFF)
option(COVERAGE "Enable running with coverage" OFF)
option(C++11 "Compile with C++11 support" OFF)
option(WERROR "Compile with warnings as errors" OFF)

{'fraction_non_alphanumeric': 0.07991696938245978, 'fraction_numerical': 0.00934094447327452, 'mean_word_length': 5.309328968903437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5724709', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1299, 'n_words': 387}