<commit_before>project(kpvcrlib)
cmake_minimum_required(VERSION 3.5.1)
enable_language(C CXX ASM)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules")
include("koreader_thirdparty_common")

set(CMAKE_ASM_COMPILER ${CMAKE_CXX_COMPILER})
set(CMAKE_ASM_COMPILER_ARG1 ${CMAKE_CXX_COMPILER_ARG1})
set(CMAKE_ASM_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_ASM_FLAGS_RELEASE "")

set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set (CMAKE_INSTALL_RPATH "$ORIGIN")

set(CR_3RDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/crengine/thirdparty)
set(CRE_DIR crengine/crengine)

set(ANTIWORD_INCLUDE_DIR ${CR_3RDPARTY_DIR}/antiword)
set(CHM_INCLUDE_DIRS ${CR_3RDPARTY_DIR}/chmlib/src)
set(CREGINE_INCLUDE_DIR ${CRE_DIR}/include)

assert_var_defined(JCONFIG_INCLUDE_DIR)
assert_var_defined(FREETYPE_INCLUDE_DIR)
assert_var_defined(HARFBUZZ_INCLUDE_DIR)
assert_var_defined(FRIBIDI_INCLUDE_DIR)
assert_var_defined(LIBUNIBREAK_INCLUDE_DIR)
assert_var_defined(UTF8PROC_INCLUDE_DIR)
assert_var_defined(PNG_INCLUDE_DIR)
assert_var_defined(ZLIB_INCLUDE_DIR)
assert_var_defined(JPEGLIB_INCLUDE_DIR)
assert_var_defined(NANOSVG_INCLUDE_DIR)
assert_var_defined(ZSTD_INCLUDE_DIR)

include_directories(
    ${JCONFIG_INCLUDE_DIR}
    ${FREETYPE_INCLUDE_DIR}
    ${HARFBUZZ_INCLUDE_DIR}
    ${FRIBIDI_INCLUDE_DIR}
    ${LIBUNIBREAK_INCLUDE_DIR}
    ${UTF8PROC_INCLUDE_DIR}
    ${ANTIWORD_INCLUDE_DIR}
    ${CHM_INCLUDE_DIRS}
    ${PNG_INCLUDE_DIR}
    ${ZLIB_INCLUDE_DIR}
    ${JPEGLIB_INCLUDE_DIR}
    ${NANOSVG_INCLUDE_DIR}
    ${ZSTD_INCLUDE_DIR}
    ${CREGINE_INCLUDE_DIR}
)

if(DEFINED ENV{WIN32})
    add_definitions(-DWIN32=1 -D_WIN32=1 -DQT_GL=1 -DMINGW -DHAVE_BOOLEAN)
else()
    add_definitions(-DLINUX=1 -D_LINUX=1)
endif()

add_definitions(<commit_msg>CRe: Disable CLOEXEC on Kindle Legacy<commit_after>project(kpvcrlib)
cmake_minimum_required(VERSION 3.5.1)
enable_language(C CXX ASM)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules")
include("koreader_thirdparty_common")

set(CMAKE_ASM_COMPILER ${CMAKE_CXX_COMPILER})
set(CMAKE_ASM_COMPILER_ARG1 ${CMAKE_CXX_COMPILER_ARG1})
set(CMAKE_ASM_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_ASM_FLAGS_RELEASE "")

set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set (CMAKE_INSTALL_RPATH "$ORIGIN")

set(CR_3RDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/crengine/thirdparty)
set(CRE_DIR crengine/crengine)

set(ANTIWORD_INCLUDE_DIR ${CR_3RDPARTY_DIR}/antiword)
set(CHM_INCLUDE_DIRS ${CR_3RDPARTY_DIR}/chmlib/src)
set(CREGINE_INCLUDE_DIR ${CRE_DIR}/include)

assert_var_defined(JCONFIG_INCLUDE_DIR)
assert_var_defined(FREETYPE_INCLUDE_DIR)
assert_var_defined(HARFBUZZ_INCLUDE_DIR)
assert_var_defined(FRIBIDI_INCLUDE_DIR)
assert_var_defined(LIBUNIBREAK_INCLUDE_DIR)
assert_var_defined(UTF8PROC_INCLUDE_DIR)
assert_var_defined(PNG_INCLUDE_DIR)
assert_var_defined(ZLIB_INCLUDE_DIR)
assert_var_defined(JPEGLIB_INCLUDE_DIR)
assert_var_defined(NANOSVG_INCLUDE_DIR)
assert_var_defined(ZSTD_INCLUDE_DIR)

include_directories(
    ${JCONFIG_INCLUDE_DIR}
    ${FREETYPE_INCLUDE_DIR}
    ${HARFBUZZ_INCLUDE_DIR}
    ${FRIBIDI_INCLUDE_DIR}
    ${LIBUNIBREAK_INCLUDE_DIR}
    ${UTF8PROC_INCLUDE_DIR}
    ${ANTIWORD_INCLUDE_DIR}
    ${CHM_INCLUDE_DIRS}
    ${PNG_INCLUDE_DIR}
    ${ZLIB_INCLUDE_DIR}
    ${JPEGLIB_INCLUDE_DIR}
    ${NANOSVG_INCLUDE_DIR}
    ${ZSTD_INCLUDE_DIR}
    ${CREGINE_INCLUDE_DIR}
)

if(DEFINED ENV{WIN32})
    add_definitions(-DWIN32=1 -D_WIN32=1 -DQT_GL=1 -DMINGW -DHAVE_BOOLEAN)
else()
    add_definitions(-DLINUX=1 -D_LINUX=1)
endif()

if(DEFINED ENV{LEGACY})
    add_definitions(-DDISABLE_CLOEXEC)
endif()

add_definitions(
{'fraction_non_alphanumeric': 0.09988901220865705, 'fraction_numerical': 0.011653718091009988, 'mean_word_length': 9.419075144508671, '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': '1193144', 'n_tokens_mistral': 1683, 'n_tokens_neox': 1506, 'n_words': 150}