<commit_before>include(FetchContent)

set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON)

FetchContent_Declare(GSL
    URL https://github.com/microsoft/GSL/archive/v3.0.0.zip
    URL_HASH SHA256=ed2d506839fd917142d562fa720459ce58c38fc5711b715779093e895a87d8c7
)
FetchContent_Declare(rapidjson
    URL https://github.com/Tencent/rapidjson/archive/v1.1.0.zip
    URL_HASH SHA256=8e00c38829d6785a2dfb951bb87c6974fa07dfe488aa5b25deec4b8bc0f6a3ab
)
FetchContent_Declare(yamlcpp
    URL https://github.com/jbeder/yaml-cpp/archive/0f9a586ca1dc29c2ecb8dd715a315b93e3f40f79.zip
    URL_HASH SHA256=ff55e0cc373295b8503faf52a5e9569b950d8ec3e704508a62fe9159c37185bc
)
FetchContent_Declare(Catch2
    URL https://github.com/catchorg/Catch2/archive/v2.9.1.zip
    URL_HASH SHA256=9a79099873c8b3156a8f7937d7976ef85bf35f46e3f0a963117be44bc9bbc5f8
)

FetchContent_GetProperties(GSL)
if(NOT gsl_POPULATED)
    FetchContent_Populate(GSL)
    add_subdirectory(${gsl_SOURCE_DIR} ${gsl_BINARY_DIR})
endif()

if(KL_ENABLE_JSON)
    FetchContent_GetProperties(rapidjson)
    if(NOT rapidjson_POPULATED)
        FetchContent_Populate(rapidjson)
        # No point in add_subdirectory() - there's no target defined
        add_library(rapidjson INTERFACE)
        add_library(rapidjson::rapidjson ALIAS rapidjson)
        target_include_directories(rapidjson SYSTEM INTERFACE ${rapidjson_SOURCE_DIR}/include)
        target_compile_definitions(rapidjson INTERFACE RAPIDJSON_HAS_STDSTRING=1)
        if(MSVC)
            target_compile_definitions(rapidjson INTERFACE _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
        endif()
    endif()
endif()

if(KL_ENABLE_YAML)
    FetchContent_GetProperties(yamlcpp)
    if(NOT yamlcpp_POPULATED)
        FetchContent_Populate(yamlcpp)

        # YAML-CPP's CMake file is very old (2.6) and doesn't use INTERFACE_ properties
        # add_subdirectory(${yamlcpp_SOURCE_DIR} ${yamlcpp_BINARY_DIR})
        add_library(yaml-cpp)
        add_library(yaml::yaml-cpp ALIAS yaml-cpp)
        file(GLOB_RECURSE sources
            "${yamlcpp_SOURCE_DIR}/src/*.cpp"
            "${yamlcpp_SOURCE_DIR}/src/*.h"
            "${yamlcpp_SOURCE_DIR}/include/yaml-cpp/*.h")
        target_sources(yaml-cpp PRIVATE ${sources})
        target_include_directories(yaml-cpp PUBLIC ${yamlcpp_SOURCE_DIR}/include)
        target_compile_features(yaml-cpp PUBLIC cxx_std_11)
        if(MSVC)
            target_compile_options(yaml-cpp PRIVATE /wd4100 /wd4127 /wd4244 /wd4456 /wd4702)
        endif()
        set_target_properties(yaml-cpp PROPERTIES FOLDER external)
    endif()
endif()<commit_msg>Ignore deprecated warnings from yaml-cpp<commit_after>include(FetchContent)

set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON)

FetchContent_Declare(GSL
    URL https://github.com/microsoft/GSL/archive/v3.0.0.zip
    URL_HASH SHA256=ed2d506839fd917142d562fa720459ce58c38fc5711b715779093e895a87d8c7
)
FetchContent_Declare(rapidjson
    URL https://github.com/Tencent/rapidjson/archive/v1.1.0.zip
    URL_HASH SHA256=8e00c38829d6785a2dfb951bb87c6974fa07dfe488aa5b25deec4b8bc0f6a3ab
)
FetchContent_Declare(yamlcpp
    URL https://github.com/jbeder/yaml-cpp/archive/0f9a586ca1dc29c2ecb8dd715a315b93e3f40f79.zip
    URL_HASH SHA256=ff55e0cc373295b8503faf52a5e9569b950d8ec3e704508a62fe9159c37185bc
)
FetchContent_Declare(Catch2
    URL https://github.com/catchorg/Catch2/archive/v2.9.1.zip
    URL_HASH SHA256=9a79099873c8b3156a8f7937d7976ef85bf35f46e3f0a963117be44bc9bbc5f8
)

FetchContent_GetProperties(GSL)
if(NOT gsl_POPULATED)
    FetchContent_Populate(GSL)
    add_subdirectory(${gsl_SOURCE_DIR} ${gsl_BINARY_DIR})
endif()

if(KL_ENABLE_JSON)
    FetchContent_GetProperties(rapidjson)
    if(NOT rapidjson_POPULATED)
        FetchContent_Populate(rapidjson)
        # No point in add_subdirectory() - there's no target defined
        add_library(rapidjson INTERFACE)
        add_library(rapidjson::rapidjson ALIAS rapidjson)
        target_include_directories(rapidjson SYSTEM INTERFACE ${rapidjson_SOURCE_DIR}/include)
        target_compile_definitions(rapidjson INTERFACE RAPIDJSON_HAS_STDSTRING=1)
        if(MSVC)
            target_compile_definitions(rapidjson INTERFACE _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
        endif()
    endif()
endif()

if(KL_ENABLE_YAML)
    FetchContent_GetProperties(yamlcpp)
    if(NOT yamlcpp_POPULATED)
        FetchContent_Populate(yamlcpp)

        # YAML-CPP's CMake file is very old (2.6) and doesn't use INTERFACE_ properties
        # add_subdirectory(${yamlcpp_SOURCE_DIR} ${yamlcpp_BINARY_DIR})
        add_library(yaml-cpp)
        add_library(yaml::yaml-cpp ALIAS yaml-cpp)
        file(GLOB_RECURSE sources
            "${yamlcpp_SOURCE_DIR}/src/*.cpp"
            "${yamlcpp_SOURCE_DIR}/src/*.h"
            "${yamlcpp_SOURCE_DIR}/include/yaml-cpp/*.h")
        target_sources(yaml-cpp PRIVATE ${sources})
        target_include_directories(yaml-cpp PUBLIC ${yamlcpp_SOURCE_DIR}/include)
        target_compile_features(yaml-cpp PUBLIC cxx_std_11)
        if(MSVC)
            target_compile_options(yaml-cpp PRIVATE
                /wd4100 /wd4127 /wd4244 /wd4456 /wd4702 /wd4996
            )
        endif()
        set_target_properties(yaml-cpp PROPERTIES FOLDER external)
    endif()
endif()
{'fraction_non_alphanumeric': 0.0817562452687358, 'fraction_numerical': 0.09084027252081757, 'mean_word_length': 4.300902708124373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, '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': '202133', 'n_tokens_mistral': 2240, 'n_tokens_neox': 1952, 'n_words': 234}