<commit_before>list(APPEND FAILURE_TESTS NONE INIT FINI OP PUMP PLUGIN_INIT ADD_DEVICE NO_ADD_DEVICE)
foreach(f ${FAILURE_TESTS})
    set(target tenyrfailure_${f})
    add_library(${target} MODULE failure.c)
    target_compile_definitions(
        ${target}
        PRIVATE
            "FAILURE_${f}=ENOTSUP"
            "FAILURE_ADD_DEVICE_FUNC=failure_${f}_add_device"
    )
    target_link_libraries(${target} PRIVATE common-pic)
    # These libraries are placed alongside the `tsim` binary in order to be
    # found.
    set_target_properties(
        ${target}
        PROPERTIES
            LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src
    )
endforeach(f)

# Override default symbols for one target.
target_compile_options(
    tenyrfailure_NO_ADD_DEVICE
    PRIVATE
        -UFAILURE_ADD_DEVICE_FUNC
        -DFAILURE_ADD_DEVICE_FUNC=unfindable_function_name
)

if(SDL)
    # TODO use find_package to set SDL build automatically.
    find_package(SDL2 REQUIRED COMPONENTS SDL2::Main SDL2::Image)
    add_library(tenyrsdlled MODULE sdlled.c)
    target_link_libraries(tenyrsdlled PUBLIC common-pic)
    target_link_libraries(tenyrsdlled PRIVATE SDL2::Main SDL2::Image)
    add_library(tenyrsdlvga MODULE sdlvga.c)
    target_link_libraries(tenyrsdlvga PUBLIC common-pic)

    # Place libraries alongside the `tsim` binary in order to be found.
    set_target_properties(tenyrsdlled tenyrsdlvga PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src)

    target_link_libraries(tenyrsdlvga PRIVATE SDL2::Main SDL2::Image)
endif()<commit_msg>Switch to pkg-config for sdl2<commit_after>list(APPEND FAILURE_TESTS NONE INIT FINI OP PUMP PLUGIN_INIT ADD_DEVICE NO_ADD_DEVICE)
foreach(f ${FAILURE_TESTS})
    set(target tenyrfailure_${f})
    add_library(${target} MODULE failure.c)
    target_compile_definitions(
        ${target}
        PRIVATE
            "FAILURE_${f}=ENOTSUP"
            "FAILURE_ADD_DEVICE_FUNC=failure_${f}_add_device"
    )
    target_link_libraries(${target} PRIVATE common-pic)
    # These libraries are placed alongside the `tsim` binary in order to be
    # found.
    set_target_properties(
        ${target}
        PROPERTIES
            LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src
    )
endforeach(f)

# Override default symbols for one target.
target_compile_options(
    tenyrfailure_NO_ADD_DEVICE
    PRIVATE
        -UFAILURE_ADD_DEVICE_FUNC
        -DFAILURE_ADD_DEVICE_FUNC=unfindable_function_name
)

if(SDL)
    include(FindPkgConfig)

    pkg_search_module(SDL2 REQUIRED sdl2)
    pkg_search_module(SDL2IMAGE REQUIRED SDL2_image>=2.0.0)

    # TODO use find_package to set SDL build automatically.
    add_library(tenyrsdlled MODULE sdlled.c)
    target_link_libraries(tenyrsdlled PUBLIC common-pic)
    add_library(tenyrsdlvga MODULE sdlvga.c)
    target_link_libraries(tenyrsdlvga PUBLIC common-pic)

    # Place libraries alongside the `tsim` binary in order to be found.
    set_target_properties(tenyrsdlled tenyrsdlvga PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src)

    target_include_directories(tenyrsdlled PRIVATE ${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS})
    target_link_libraries(tenyrsdlled PRIVATE ${SDL2_LINK_LIBRARIES} ${SDL2IMAGE_LINK_LIBRARIES})
    target_include_directories(tenyrsdlvga PRIVATE ${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS})
    target_link_libraries(tenyrsdlvga PRIVATE ${SDL2_LINK_LIBRARIES} ${SDL2IMAGE_LINK_LIBRARIES})
endif()
{'fraction_non_alphanumeric': 0.0728169422686394, 'fraction_numerical': 0.006672468813460981, 'mean_word_length': 4.438485804416404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '894080', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1159, 'n_words': 225}