<commit_before>cmake_minimum_required(VERSION 2.8)

project(salt-channel-c)
enable_language(C)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_package(Sanitizers)


option(USE_SODIUM "Use TweetNaCl as crypto native" OFF)

if(USE_SODIUM)
	include_directories ("${PROJECT_SOURCE_DIR}/src/external/libsodium")
	include_directories ("${PROJECT_SOURCE_DIR}/src/external/libsodium/include")
	set(EXTRA_LIBS ${EXTRA_LIBS} libsodium.a)
	add_definitions(-DUSE_SODIUM=1)
else(USE_SODIUM)
	include_directories ("${PROJECT_SOURCE_DIR}/src/external/tweetnacl")
	set(EXTRA_LIBS ${EXTRA_LIBS} tweetnacl)
	set_source_files_properties(src/external/tweetnacl/tweetnacl.c PROPERTIES COMPILE_FLAGS -Wno-sign-compare)
	add_library(tweetnacl src/external/tweetnacl/tweetnacl.c)
	add_sanitizers(tweetnacl)

	set_source_files_properties(src/external/tweetnacl_modified/tweetnacl_modified.c PROPERTIES COMPILE_FLAGS -Wno-sign-compare)
	add_library(tweetnacl_modified src/external/tweetnacl_modified/tweetnacl_modified.c)
	add_sanitizers(tweetnacl_modified)
endif(USE_SODIUM)

set(CMAKE_C_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage -std=c99 ${CMAKE_CXX_FLAGS_DEBUG}")
add_definitions(-O0 -g -ggdb -DSALT_DEBUG=1 -Wall -Werror -Wpedantic  -std=c99)<commit_msg>Use dynamic sodium lib<commit_after>cmake_minimum_required(VERSION 2.8)

project(salt-channel-c)
enable_language(C)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_package(Sanitizers)


option(USE_SODIUM "Use TweetNaCl as crypto native" OFF)

if(USE_SODIUM)
	include_directories ("${PROJECT_SOURCE_DIR}/src/external/libsodium")
	include_directories ("${PROJECT_SOURCE_DIR}/src/external/libsodium/include")
	set(EXTRA_LIBS ${EXTRA_LIBS} sodium)
	add_definitions(-DUSE_SODIUM=1)
else(USE_SODIUM)
	include_directories ("${PROJECT_SOURCE_DIR}/src/external/tweetnacl")
	set(EXTRA_LIBS ${EXTRA_LIBS} tweetnacl)
	set_source_files_properties(src/external/tweetnacl/tweetnacl.c PROPERTIES COMPILE_FLAGS -Wno-sign-compare)
	add_library(tweetnacl src/external/tweetnacl/tweetnacl.c)
	add_sanitizers(tweetnacl)

	set_source_files_properties(src/external/tweetnacl_modified/tweetnacl_modified.c PROPERTIES COMPILE_FLAGS -Wno-sign-compare)
	add_library(tweetnacl_modified src/external/tweetnacl_modified/tweetnacl_modified.c)
	add_sanitizers(tweetnacl_modified)
endif(USE_SODIUM)

set(CMAKE_C_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage -std=c99 ${CMAKE_CXX_FLAGS_DEBUG}")
add_definitions(-O0 -g -ggdb -DSALT_DEBUG=1 -Wall -Werror -Wpedantic  -std=c99)
{'fraction_non_alphanumeric': 0.11018957345971564, 'fraction_numerical': 0.0071090047393364926, 'mean_word_length': 8.77992277992278, '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': '5235644', 'n_tokens_mistral': 1045, 'n_tokens_neox': 998, 'n_words': 118}