<commit_before>add_subdirectory(third_party)

if(MSVC)
    # We need full support for C++ exceptions
    add_compile_options(/EHsc)
    # -Wall -Wextra -pedantic
    add_compile_options(/W4)
    # 'argument' : conversion from 'type1' to 'type2', possible loss of data
    add_compile_options(/wd4244)
    # 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
    # This is due to the fact that we're using STL containers in the interface
    add_compile_options(/wd4251)
    # 'var' : conversion from 'size_t' to 'type', possible loss of data
    add_compile_options(/wd4267)
    # cast truncates constant value
    add_compile_options(/wd4310)
    # declaration of 'identifier' hides previous local declaration
    add_compile_options(/wd4456)
    # 'strcat': This function or variable may be unsafe
    add_compile_options(/wd4996)
else()
    add_compile_options(-Wall -Wextra -pedantic)
    # define compiler flags for all code, copied from Autoconf's AC_SYS_LARGEFILE
    add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE)
endif()

###########
# library #
###########

# needed for reading compressed BAM files
find_package(ZLIB REQUIRED)

# create main BamTools API library
add_library(
    BamTools

    api/BamAlignment.cpp
    api/BamMultiReader.cpp
    api/BamReader.cpp
    api/BamWriter.cpp
    api/SamHeader.cpp
    api/SamProgram.cpp
    api/SamProgramChain.cpp
    api/SamReadGroup.cpp
    api/SamReadGroupDictionary.cpp
    api/SamSequence.cpp
    api/SamSequenceDictionary.cpp
    api/internal/bam/BamHeader_p.cpp
    api/internal/bam/BamMultiReader_p.cpp
    api/internal/bam/BamRandomAccessController_p.cpp
    api/internal/bam/BamReader_p.cpp
    api/internal/bam/BamWriter_p.cpp
    api/internal/index/BamIndexFactory_p.cpp
    api/internal/index/BamStandardIndex_p.cpp
    api/internal/index/BamToolsIndex_p.cpp
    api/internal/io/BamDeviceFactory_p.cpp
    api/internal/io/BamFile_p.cpp
    api/internal/io/BamFtp_p.cpp
    api/internal/io/BamHttp_p.cpp
    api/internal/io/BamPipe_p.cpp
    api/internal/io/BgzfStream_p.cpp
    api/internal/io/ByteArray_p.cpp
    api/internal/io/HostAddress_p.cpp
    api/internal/io/HostInfo_p.cpp
    api/internal/io/HttpHeader_p.cpp
    api/internal/io/ILocalIODevice_p.cpp
    api/internal/io/RollingBuffer_p.cpp
    api/internal/io/TcpSocketEngine_p.cpp
    api/internal/io/TcpSocket_p.cpp
    api/internal/sam/SamFormatParser_p.cpp
    api/internal/sam/SamFormatPrinter_p.cpp
    api/internal/sam/SamHeaderValidator_p.cpp
    api/internal/utils/BamException_p.cpp
)

# The SONAME is bumped on every version increment
# as Bamtools does not yet guarantee a stable ABI
set_target_properties(
    BamTools PROPERTIES
    SOVERSION ${BamTools_VERSION}
    OUTPUT_NAME bamtools
    CXX_STANDARD 11
    CXX_STANDARD_REQUIRED ON
    CXX_EXTENSIONS OFF)
target_include_directories(
    BamTools PRIVATE
    ${ZLIB_INCLUDE_DIRS}
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(
    BamTools PRIVATE
    ${ZLIB_LIBRARIES})

if(WIN32)
    target_link_libraries(<commit_msg>making include folders visible to users<commit_after>add_subdirectory(third_party)

if(MSVC)
    # We need full support for C++ exceptions
    add_compile_options(/EHsc)
    # -Wall -Wextra -pedantic
    add_compile_options(/W4)
    # 'argument' : conversion from 'type1' to 'type2', possible loss of data
    add_compile_options(/wd4244)
    # 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
    # This is due to the fact that we're using STL containers in the interface
    add_compile_options(/wd4251)
    # 'var' : conversion from 'size_t' to 'type', possible loss of data
    add_compile_options(/wd4267)
    # cast truncates constant value
    add_compile_options(/wd4310)
    # declaration of 'identifier' hides previous local declaration
    add_compile_options(/wd4456)
    # 'strcat': This function or variable may be unsafe
    add_compile_options(/wd4996)
else()
    add_compile_options(-Wall -Wextra -pedantic)
    # define compiler flags for all code, copied from Autoconf's AC_SYS_LARGEFILE
    add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE)
endif()

###########
# library #
###########

# needed for reading compressed BAM files
find_package(ZLIB REQUIRED)

# create main BamTools API library
add_library(
    BamTools

    api/BamAlignment.cpp
    api/BamMultiReader.cpp
    api/BamReader.cpp
    api/BamWriter.cpp
    api/SamHeader.cpp
    api/SamProgram.cpp
    api/SamProgramChain.cpp
    api/SamReadGroup.cpp
    api/SamReadGroupDictionary.cpp
    api/SamSequence.cpp
    api/SamSequenceDictionary.cpp
    api/internal/bam/BamHeader_p.cpp
    api/internal/bam/BamMultiReader_p.cpp
    api/internal/bam/BamRandomAccessController_p.cpp
    api/internal/bam/BamReader_p.cpp
    api/internal/bam/BamWriter_p.cpp
    api/internal/index/BamIndexFactory_p.cpp
    api/internal/index/BamStandardIndex_p.cpp
    api/internal/index/BamToolsIndex_p.cpp
    api/internal/io/BamDeviceFactory_p.cpp
    api/internal/io/BamFile_p.cpp
    api/internal/io/BamFtp_p.cpp
    api/internal/io/BamHttp_p.cpp
    api/internal/io/BamPipe_p.cpp
    api/internal/io/BgzfStream_p.cpp
    api/internal/io/ByteArray_p.cpp
    api/internal/io/HostAddress_p.cpp
    api/internal/io/HostInfo_p.cpp
    api/internal/io/HttpHeader_p.cpp
    api/internal/io/ILocalIODevice_p.cpp
    api/internal/io/RollingBuffer_p.cpp
    api/internal/io/TcpSocketEngine_p.cpp
    api/internal/io/TcpSocket_p.cpp
    api/internal/sam/SamFormatParser_p.cpp
    api/internal/sam/SamFormatPrinter_p.cpp
    api/internal/sam/SamHeaderValidator_p.cpp
    api/internal/utils/BamException_p.cpp
)

# The SONAME is bumped on every version increment
# as Bamtools does not yet guarantee a stable ABI
set_target_properties(
    BamTools PROPERTIES
    SOVERSION ${BamTools_VERSION}
    OUTPUT_NAME bamtools
    CXX_STANDARD 11
    CXX_STANDARD_REQUIRED ON
    CXX_EXTENSIONS OFF)
target_include_directories(
    BamTools PRIVATE
    ${ZLIB_INCLUDE_DIRS}
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
    SYSTEM INTERFACE
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(
    BamTools PRIVATE
    ${ZLIB_LIBRARIES})

if(WIN32)
    target_link_libraries(
{'fraction_non_alphanumeric': 0.08716099702147673, 'fraction_numerical': 0.011600564351779277, 'mean_word_length': 3.7754491017964074, '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': '5749187', 'n_tokens_mistral': 2291, 'n_tokens_neox': 2216, 'n_words': 410}