<commit_before>cmake_minimum_required(VERSION 2.8.7)

include(CMakeParseArguments)

# optionally include cotire - the git submodule might not be inited (or the user might have already included it)
if(NOT COMMAND cotire)
    include(${CMAKE_CURRENT_LIST_DIR}/../cotire/CMake/cotire.cmake OPTIONAL)
endif()

if(COMMAND cotire AND "1.7.2" VERSION_LESS "${COTIRE_CMAKE_MODULE_VERSION}")
    set(ucm_with_cotire 1)
else()
    set(ucm_with_cotire 0)
endif()

option(UCM_UNITY_BUILD          "Enable unity build for targets registered with the ucm_add_target() macro"                     OFF)
option(UCM_NO_COTIRE_FOLDER     "Do not use a cotire folder in the solution explorer for all unity and cotire related targets"  ON)

# ucm_add_flags
# Adds compiler flags to CMAKE_<LANG>_FLAGS or to a specific config
macro(ucm_add_flags)
    cmake_parse_arguments(ARG "C;CXX;CLEAR_OLD" "CONFIG" "" ${ARGN})
    
    # determine to which flags to add
    set(CXX_FLAGS CMAKE_CXX_FLAGS)
    set(C_FLAGS CMAKE_C_FLAGS)
    if(NOT "${ARG_CONFIG}" STREQUAL "")
        string(TOUPPER ${ARG_CONFIG} ARG_CONFIG)
        set(CXX_FLAGS CMAKE_CXX_FLAGS_${ARG_CONFIG})
        set(C_FLAGS CMAKE_C_FLAGS_${ARG_CONFIG})
    endif()
    
    # clear the old flags
    if(${ARG_CLEAR_OLD})
        if("${ARG_CXX}" OR NOT "${ARG_C}")
            set(${CXX_FLAGS} "")
        endif()
        if("${ARG_C}" OR NOT "${ARG_CXX}")
            set(${C_FLAGS} "")
        endif()
    endif()
    
    # add all the passed flags
    foreach(flag ${ARG_UNPARSED_ARGUMENTS})
        if("${ARG_CXX}" OR NOT "${ARG_C}")
            set(${CXX_FLAGS} "${${CXX_FLAGS}} ${flag}")
        endif()
        if("${ARG_C}" OR NOT "${ARG_CXX}")
            set(${C_FLAGS} "${${C_FLAGS}} ${flag}")
        endif()
    endforeach()
endmacro()

# ucm_set_flags
# Sets the CMAKE_<LANG>_FLAGS compiler flags or for a specific config
macro(ucm_set_flags)
    ucm_add_flags(CLEAR_OLD ${ARGN})
endmacro()

# ucm_set_runtime
# Sets the runtime (static/dynamic) for msvc/gcc
macro(ucm_set_runtime)
    cmake_parse_arguments(ARG "STATIC;DYNAMIC;PRINT_FLAGS" "" "" ${ARGN})
    
    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ${PRINT_FLAGS} STREQUAL "")
        message(AUTHOR_WARNING "ucm_set_runtime() does not support clang yet!")
    endif()
    
    # gather list of flags to handle
    set(flags_configs "")
    if("${CMAKE_CONFIGURATION_TYPES}" STREQUAL "")
        # handle single config generators - like makefiles/ninja
        if("${CMAKE_BUILD_TYPE}" STREQUAL "")
            list(APPEND flags_configs CMAKE_C_FLAGS)<commit_msg>fixing build...<commit_after>cmake_minimum_required(VERSION 2.8.7)

include(CMakeParseArguments)

# optionally include cotire - the git submodule might not be inited (or the user might have already included it)
if(NOT COMMAND cotire)
    include(${CMAKE_CURRENT_LIST_DIR}/../cotire/CMake/cotire.cmake OPTIONAL)
endif()

if(COMMAND cotire AND "1.7.2" VERSION_LESS "${COTIRE_CMAKE_MODULE_VERSION}")
    set(ucm_with_cotire 1)
else()
    set(ucm_with_cotire 0)
endif()

option(UCM_UNITY_BUILD          "Enable unity build for targets registered with the ucm_add_target() macro"                     OFF)
option(UCM_NO_COTIRE_FOLDER     "Do not use a cotire folder in the solution explorer for all unity and cotire related targets"  ON)

# ucm_add_flags
# Adds compiler flags to CMAKE_<LANG>_FLAGS or to a specific config
macro(ucm_add_flags)
    cmake_parse_arguments(ARG "C;CXX;CLEAR_OLD" "CONFIG" "" ${ARGN})
    
    # determine to which flags to add
    set(CXX_FLAGS CMAKE_CXX_FLAGS)
    set(C_FLAGS CMAKE_C_FLAGS)
    if(NOT "${ARG_CONFIG}" STREQUAL "")
        string(TOUPPER ${ARG_CONFIG} ARG_CONFIG)
        set(CXX_FLAGS CMAKE_CXX_FLAGS_${ARG_CONFIG})
        set(C_FLAGS CMAKE_C_FLAGS_${ARG_CONFIG})
    endif()
    
    # clear the old flags
    if(${ARG_CLEAR_OLD})
        if("${ARG_CXX}" OR NOT "${ARG_C}")
            set(${CXX_FLAGS} "")
        endif()
        if("${ARG_C}" OR NOT "${ARG_CXX}")
            set(${C_FLAGS} "")
        endif()
    endif()
    
    # add all the passed flags
    foreach(flag ${ARG_UNPARSED_ARGUMENTS})
        if("${ARG_CXX}" OR NOT "${ARG_C}")
            set(${CXX_FLAGS} "${${CXX_FLAGS}} ${flag}")
        endif()
        if("${ARG_C}" OR NOT "${ARG_CXX}")
            set(${C_FLAGS} "${${C_FLAGS}} ${flag}")
        endif()
    endforeach()
endmacro()

# ucm_set_flags
# Sets the CMAKE_<LANG>_FLAGS compiler flags or for a specific config
macro(ucm_set_flags)
    ucm_add_flags(CLEAR_OLD ${ARGN})
endmacro()

# ucm_set_runtime
# Sets the runtime (static/dynamic) for msvc/gcc
macro(ucm_set_runtime)
    cmake_parse_arguments(ARG "STATIC;DYNAMIC;PRINT_FLAGS" "" "" ${ARGN})
    
    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND "${ARG_PRINT_FLAGS}" STREQUAL "")
        message(AUTHOR_WARNING "ucm_set_runtime() does not support clang yet!")
    endif()
    
    # gather list of flags to handle
    set(flags_configs "")
    if("${CMAKE_CONFIGURATION_TYPES}" STREQUAL "")
        # handle single config generators - like makefiles/ninja
        if("${CMAKE_BUILD_TYPE}" STREQUAL "")
            list(APPEND flags_configs CMAKE_C_FLAGS)
{'fraction_non_alphanumeric': 0.1202556158017041, 'fraction_numerical': 0.003098373353989156, 'mean_word_length': 3.4718614718614718, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6367606', 'n_tokens_mistral': 1886, 'n_tokens_neox': 1786, 'n_words': 420}