<commit_before>file(GLOB lily_SOURCES *.c *.h)

# The reason I've called this liblily but removed the prefix is so that I can
# use liblily to build the lily executable.
# -fPIC is vital: Apache's mod_lily will not build properly without it.
add_library(liblily STATIC ${lily_SOURCES})
if(NOT MSVC)
    target_link_libraries(liblily dl)
    set_target_properties(
        liblily
        PROPERTIES
            COMPILE_FLAGS "-fPIC"
            PREFIX ""
    )
endif()

install(FILES lily_api_alloc.h
              lily_api_options.h
              lily_api_value_ops.h
        DESTINATION "lily")
<commit_msg>Build on the BSDs. BSD libc includes the dl* family of functions for loading dynamic libraries. Attempting to link against libdl will fail on them, so don't do that.<commit_after>file(GLOB lily_SOURCES *.c *.h)

# BSD libc includes the dl* functions and there's no libdl on them.
# Unfortunately, CMake doesn't seem to distinguish *BSD from the other *nixen.
STRING(REGEX MATCH "BSD" IS_BSD ${CMAKE_SYSTEM_NAME})

# The reason I've called this liblily but removed the prefix is so that I can
# use liblily to build the lily executable.
# -fPIC is vital: Apache's mod_lily will not build properly without it.
add_library(liblily STATIC ${lily_SOURCES})
if(NOT MSVC)
    if(IS_BSD)
        target_link_libraries(liblily)
    else()
        target_link_libraries(liblily dl)
    endif()
    set_target_properties(
        liblily
        PROPERTIES
            COMPILE_FLAGS "-fPIC"
            PREFIX ""
    )
endif()

install(FILES lily_api_alloc.h
              lily_api_options.h
              lily_api_value_ops.h
        DESTINATION "lily")

{'fraction_non_alphanumeric': 0.07078039927404718, 'fraction_numerical': 0.0, 'mean_word_length': 2.985542168674699, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7513902', 'n_tokens_mistral': 565, 'n_tokens_neox': 527, 'n_words': 174}