<commit_before>cmake_minimum_required(VERSION 2.8)
project (ForestDB)

IF (${CMAKE_MAJOR_VERSION} GREATER 2)
    CMAKE_POLICY(SET CMP0042 NEW)
ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)

INCLUDE(CheckFunctionExists)
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckLibraryExists)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckTypeSize)
INCLUDE(CTest)

include_directories(BEFORE ${PROJECT_SOURCE_DIR}/option)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/utils)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/src)

CHECK_INCLUDE_FILES("atomic.h" HAVE_ATOMIC_H)
CHECK_INCLUDE_FILES("sched.h" HAVE_SCHED_H)

CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/src/config.cmake.h
                ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)

LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")

if (COUCHBASE_SERVER_BUILD)
    ADD_DEFINITIONS(-D_DOC_COMP=1 -D_CRC32C=1)
    include_directories(AFTER ${SNAPPY_INCLUDE_DIR})
    include_directories(AFTER ${Platform_SOURCE_DIR}/include)
    set(PLATFORM_LIBRARY platform)
    set(DIRUTILS_LIBRARY dirutils)
    set(GTEST_LIBRARY gtest)
else(COUCHBASE_SERVER_BUILD)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D__DEBUG")
    if (NOT WIN32)
        if (NOT(SNAPPY_OPTION STREQUAL "Disable"))
            INCLUDE(FindSnappy)
            ADD_DEFINITIONS(-D_DOC_COMP=1)
        endif (NOT(SNAPPY_OPTION STREQUAL "Disable"))
    endif(NOT WIN32)
    if (_JEMALLOC EQUAL 1)
        INCLUDE(FindJemalloc)
    endif(_JEMALLOC EQUAL 1)
    if (EXISTS "${PROJECT_SOURCE_DIR}/platform/")
        INCLUDE(CouchbaseCodeCoverage)
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
        INCLUDE (CMakePushCheckState)
        include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/platform/include)
        ADD_SUBDIRECTORY(platform)
        set(PLATFORM_LIBRARY platform)
        ADD_DEFINITIONS(-D_CRC32C=1)
        include_directories(AFTER ${PROJECT_SOURCE_DIR}/platform/include)
    endif(EXISTS "${PROJECT_SOURCE_DIR}/platform/")
endif(COUCHBASE_SERVER_BUILD)

INCLUDE(FindAsyncIOLib)

FIND_LIBRARY(EXECINFO_LIBRARY
        NAMES execinfo)
if (EXECINFO_LIBRARY)
    set(BACKTRACE_LIBRARIES "${EXECINFO_LIBRARY}")
endif (EXECINFO_LIBRARY)

if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)

if (NOT WIN32)
    set ( CMAKE_CXX_FLAGS_DEBUG "-O0 -Wunused-variable -Wall -pedantic -std=c++11 -Wredundant-decls")<commit_msg>build fix:add -D_GNU_SOURCE & -std=gnu99 for platform<commit_after>cmake_minimum_required(VERSION 2.8)
project (ForestDB)

IF (${CMAKE_MAJOR_VERSION} GREATER 2)
    CMAKE_POLICY(SET CMP0042 NEW)
ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)

INCLUDE(CheckFunctionExists)
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckLibraryExists)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckTypeSize)
INCLUDE(CTest)

include_directories(BEFORE ${PROJECT_SOURCE_DIR}/option)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/utils)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/src)

CHECK_INCLUDE_FILES("atomic.h" HAVE_ATOMIC_H)
CHECK_INCLUDE_FILES("sched.h" HAVE_SCHED_H)

CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/src/config.cmake.h
                ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)

LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")

if (COUCHBASE_SERVER_BUILD)
    ADD_DEFINITIONS(-D_DOC_COMP=1 -D_CRC32C=1)
    include_directories(AFTER ${SNAPPY_INCLUDE_DIR})
    include_directories(AFTER ${Platform_SOURCE_DIR}/include)
    set(PLATFORM_LIBRARY platform)
    set(DIRUTILS_LIBRARY dirutils)
    set(GTEST_LIBRARY gtest)
else(COUCHBASE_SERVER_BUILD)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D__DEBUG")
    if (NOT WIN32)
        if (NOT(SNAPPY_OPTION STREQUAL "Disable"))
            INCLUDE(FindSnappy)
            ADD_DEFINITIONS(-D_DOC_COMP=1)
        endif (NOT(SNAPPY_OPTION STREQUAL "Disable"))
    endif(NOT WIN32)
    if (_JEMALLOC EQUAL 1)
        INCLUDE(FindJemalloc)
    endif(_JEMALLOC EQUAL 1)
    if (EXISTS "${PROJECT_SOURCE_DIR}/platform/")
        INCLUDE(CouchbaseCodeCoverage)
        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -std=gnu99")
        INCLUDE (CMakePushCheckState)
        include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/platform/include)
        ADD_SUBDIRECTORY(platform)
        set(PLATFORM_LIBRARY platform)
        ADD_DEFINITIONS(-D_CRC32C=1)
        include_directories(AFTER ${PROJECT_SOURCE_DIR}/platform/include)
    endif(EXISTS "${PROJECT_SOURCE_DIR}/platform/")
endif(COUCHBASE_SERVER_BUILD)

INCLUDE(FindAsyncIOLib)

FIND_LIBRARY(EXECINFO_LIBRARY
        NAMES execinfo)
if (EXECINFO_LIBRARY)
    set(BACKTRACE_LIBRARIES "${EXECINFO_LIBRARY}")
endif (EXECINFO_LIBRARY)

if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)

if (NOT WIN32)
    set ( CMAKE_CXX_FLAGS_DEBUG "-O0 -Wunused-variable -Wall -pedantic -std=c++11 -Wredundant-decls")
{'fraction_non_alphanumeric': 0.09942814978786202, 'fraction_numerical': 0.011068068622025456, 'mean_word_length': 5.572121212121212, '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': '600599', 'n_tokens_mistral': 2142, 'n_tokens_neox': 1941, 'n_words': 300}