<commit_before>cmake_minimum_required(VERSION 2.8)
project(dfk C)

if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
  message(FATAL_ERROR "\nIn-source builds are not allowed.\nTry 'mkdir build && cd build && cmake ..'")
endif()

set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cpm_packages)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(fw)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)

fw_version_from_git(DFK_VERSION DFK_VERSION_MAJOR DFK_VERSION_MINOR DFK_VERSION_PATCH)
fw_page_size(page_size)

set(DFK_BUILD_UNIT_TESTS TRUE CACHE BOOL "")
set(DFK_BUILD_AUTO_TESTS TRUE CACHE BOOL "")
set(DFK_BUILD_SAMPLES FALSE CACHE BOOL "")

set(DFK_PAGE_SIZE ${page_size} CACHE STRING "")
set(DFK_DEFAULT_STACK_SIZE 1048576 CACHE STRING "")
set(DFK_DEFAULT_TCP_BACKLOG 128 CACHE STRING "")
set(DFK_COROUTINE_ASM TRUE CACHE BOOL "")
set(DFK_EVENT_LOOP_LIBUV TRUE CACHE BOOL "")
set(DFK_ENABLE_DEBUG TRUE CACHE BOOL "")

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/thirdparty")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src")

check_include_files(assert.h DFK_HAVE_ASSERT_H)
check_include_files(stddef.h DFK_HAVE_STDDEF_H)
check_include_files(stdint.h DFK_HAVE_STDINT_H)
check_include_files(stdlib.h DFK_HAVE_STDLIB_H)
check_include_files(string.h DFK_HAVE_STRING_H)
check_include_files(stdio.h DFK_HAVE_STDIO_H)
check_include_files(signal.h DFK_HAVE_SIGNAL_H)
check_include_files(unistd.h DFK_HAVE_UNISTD_H)
check_include_files(pthread.h DFK_HAVE_PTHREAD_H)<commit_msg>devenv: Enable DFK_BUILD_SAMPLES by default<commit_after>cmake_minimum_required(VERSION 2.8)
project(dfk C)

if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
  message(FATAL_ERROR "\nIn-source builds are not allowed.\nTry 'mkdir build && cd build && cmake ..'")
endif()

set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cpm_packages)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(fw)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)

fw_version_from_git(DFK_VERSION DFK_VERSION_MAJOR DFK_VERSION_MINOR DFK_VERSION_PATCH)
fw_page_size(page_size)

set(DFK_BUILD_UNIT_TESTS TRUE CACHE BOOL "")
set(DFK_BUILD_AUTO_TESTS TRUE CACHE BOOL "")
set(DFK_BUILD_SAMPLES TRUE CACHE BOOL "")

set(DFK_PAGE_SIZE ${page_size} CACHE STRING "")
set(DFK_DEFAULT_STACK_SIZE 1048576 CACHE STRING "")
set(DFK_DEFAULT_TCP_BACKLOG 128 CACHE STRING "")
set(DFK_COROUTINE_ASM TRUE CACHE BOOL "")
set(DFK_EVENT_LOOP_LIBUV TRUE CACHE BOOL "")
set(DFK_ENABLE_DEBUG TRUE CACHE BOOL "")

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/thirdparty")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src")

check_include_files(assert.h DFK_HAVE_ASSERT_H)
check_include_files(stddef.h DFK_HAVE_STDDEF_H)
check_include_files(stdint.h DFK_HAVE_STDINT_H)
check_include_files(stdlib.h DFK_HAVE_STDLIB_H)
check_include_files(string.h DFK_HAVE_STRING_H)
check_include_files(stdio.h DFK_HAVE_STDIO_H)
check_include_files(signal.h DFK_HAVE_SIGNAL_H)
check_include_files(unistd.h DFK_HAVE_UNISTD_H)
check_include_files(pthread.h DFK_HAVE_PTHREAD_H)
{'fraction_non_alphanumeric': 0.09451851851851852, 'fraction_numerical': 0.0071111111111111115, 'mean_word_length': 11.550185873605948, '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': '7410197', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1279, 'n_words': 185}