<commit_before>cmake_minimum_required(VERSION 2.8) 
project(AUTHENC C ASM)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -std=c99 -Werror")

include_directories("include")

set(BACKEND "ref" CACHE STRING "Backend to use.")

file(GLOB LIB_SRCS "src/*.c")
file(GLOB_RECURSE BACKEND_SRCS "src/${BACKEND}/*.c" "src/${BACKEND}/*.S" "src/${BACKEND}/*.s")

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/${BACKEND}/CMakeLists.txt")
	add_subdirectory("src/${BACKEND}/")
endif() 

list(APPEND LIB_SRCS ${BACKEND_SRCS})
add_library(authenc ${LIB_SRCS})

enable_testing()

add_executable(test_bc_aes test/test_bc_aes.c)
target_link_libraries(test_bc_aes authenc)
add_executable(test_sc_aesctr test/test_sc_aesctr.c)
target_link_libraries(test_sc_aesctr authenc)
add_executable(test_ac_gcm test/test_ac_gcm.c)
target_link_libraries(test_ac_gcm authenc)<commit_msg>CMake script builds benchmark if available.<commit_after>cmake_minimum_required(VERSION 2.8) 
project(AUTHENC C ASM)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -std=c99 -Werror -D_POSIX_C_SOURCE=199309L")

include_directories("include")

set(BACKEND "ref" CACHE STRING "Backend to use.")

file(GLOB LIB_SRCS "src/*.c")
file(GLOB_RECURSE BACKEND_SRCS "src/${BACKEND}/*.c" "src/${BACKEND}/*.S" "src/${BACKEND}/*.s")

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/${BACKEND}/CMakeLists.txt")
	add_subdirectory("src/${BACKEND}/")
endif() 

list(APPEND LIB_SRCS ${BACKEND_SRCS})
add_library(authenc ${LIB_SRCS})

enable_testing()

add_executable(test_bc_aes test/test_bc_aes.c)
target_link_libraries(test_bc_aes authenc)
add_executable(test_sc_aesctr test/test_sc_aesctr.c)
target_link_libraries(test_sc_aesctr authenc)
add_executable(test_ac_gcm test/test_ac_gcm.c)
target_link_libraries(test_ac_gcm authenc)

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/bench/authenc_bench.c")
	add_executable(bench_ac_gcm bench/bench_ac_gcm.c bench/authenc_bench.c)
	target_link_libraries(bench_ac_gcm authenc rt)
endif()

{'fraction_non_alphanumeric': 0.13720452209660844, 'fraction_numerical': 0.007194244604316547, 'mean_word_length': 8.497560975609757, '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': '2586760', 'n_tokens_mistral': 845, 'n_tokens_neox': 813, 'n_words': 112}