<commit_before>cmake_minimum_required(VERSION 3.18)

project(qiss VERSION 0)
include(cmake/StandardProjectSettings.cmake)

find_package(FLEX REQUIRED)
flex_target(lexer src/qiss.l "${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c"
    COMPILE_FLAGS -s
    DEFINES_FILE "${CMAKE_CURRENT_BINARY_DIR}/lex.yy.h")
add_library(lex ${FLEX_lexer_OUTPUTS})
target_include_directories(lex PUBLIC src)
set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c" PROPERTIES
    COMPILE_OPTIONS "-Wno-conversion;-Wno-unused-parameter")

add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_20)
target_compile_options(project_options INTERFACE
    $<$<CONFIG:RELEASE>:-ffast-math>
# TODO fix for non-x86 targets
    $<$<CONFIG:RELEASE>:-mavx2>
)

add_library(project_warnings INTERFACE)
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
include(cmake/StaticAnalyzers.cmake)

set(CORE
    src/adverb.cpp
    src/arith.cpp
    src/at.cpp
    src/atomic.cpp
    src/bang.cpp
    src/binary2unary.cpp
    src/bits.cpp
    src/buddy_allocator.cpp
    src/cat.cpp
    src/compile.cpp
    src/converge.cpp
    src/count.cpp
    src/detect.cpp
    src/distinct.cpp<commit_msg>Remove -ffast-math (bad!); add -fno-rtti<commit_after>cmake_minimum_required(VERSION 3.18)

project(qiss VERSION 0)
include(cmake/StandardProjectSettings.cmake)

find_package(FLEX REQUIRED)
flex_target(lexer src/qiss.l "${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c"
    COMPILE_FLAGS -s
    DEFINES_FILE "${CMAKE_CURRENT_BINARY_DIR}/lex.yy.h")
add_library(lex ${FLEX_lexer_OUTPUTS})
target_include_directories(lex PUBLIC src)
set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c" PROPERTIES
    COMPILE_OPTIONS "-Wno-conversion;-Wno-unused-parameter")

add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_20)
target_compile_options(project_options INTERFACE
    -fno-rtti
# TODO fix for non-x86 targets
    $<$<CONFIG:RELEASE>:-mavx2>
)

add_library(project_warnings INTERFACE)
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
include(cmake/StaticAnalyzers.cmake)

set(CORE
    src/adverb.cpp
    src/arith.cpp
    src/at.cpp
    src/atomic.cpp
    src/bang.cpp
    src/binary2unary.cpp
    src/bits.cpp
    src/buddy_allocator.cpp
    src/cat.cpp
    src/compile.cpp
    src/converge.cpp
    src/count.cpp
    src/detect.cpp
    src/distinct.cpp
{'fraction_non_alphanumeric': 0.10395655546935609, 'fraction_numerical': 0.007757951900698216, 'mean_word_length': 5.30562347188264, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6666867', 'n_tokens_mistral': 996, 'n_tokens_neox': 964, 'n_words': 123}