<commit_before>cmake_minimum_required(VERSION 2.6)
project(OpenOMF C)

SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake-scripts)
find_package(SDL2)
find_package(shadowdive)
find_package(enet)
find_package(dumb)
find_package(OpenAL)
find_package(confuse)

# These flags are used for all builds
set(CORE_FLAGS "-Wall")

# Check available compiler
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
    if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
        set(CORE_FLAGS "${CORE_FLAGS} -std=c99")
    elseif(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
        message(FATAL_ERROR "GCC version must be at least 4.6!")
    else()
        set(CORE_FLAGS "${CORE_FLAGS} -std=c11")
    endif()
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
    set(CORE_FLAGS "${CORE_FLAGS} -std=c11")
    # On travis CMAKE_C_COMPILER_VERSION returns an empty string!
    if("${CMAKE_C_COMPILER_VERSION}" STREQUAL "")
        message(WARNING "Could not determine the version of your Clang compiler")
    else()
        if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.2)
            message(FATAL_ERROR "Clang version must be at least 3.2!")
        endif()
    endif()
else()
    set(CORE_FLAGS "${CORE_FLAGS} -std=c11")
    message(WARNING "Unsupported compiler!")
endif()

# When building with MingW, do not look for Libintl
# Also, use static libgcc when on mingw
IF(MINGW)
    set(LIBINTL_INCLUDE_DIR "")
    set(LIBINTL_LIBRARIES "")
    set(CORE_FLAGS "${CORE_FLAGS} -static-libgcc")
ELSE(MINGW)
    find_package(Libintl)
ENDIF(MINGW)

# Options
OPTION(USE_OGGVORBIS "Add support for Ogg Vorbis audio" OFF)
OPTION(USE_PNG "Add support for PNG screenshots" OFF)
OPTION(SERVER_ONLY "Do not build the game binary" OFF)

# If we want to build support for vorbis streaming, find these too
IF(USE_OGGVORBIS)
    find_package(ogg)
    find_package(vorbis)
    set(CORE_FLAGS "${CORE_FLAGS} -DUSE_OGGVORBIS")
ENDIF(USE_OGGVORBIS)

IF(USE_PNG)
    find_package(PNG)
    find_package(ZLIB)
    set(CORE_FLAGS "${CORE_FLAGS} -DUSE_PNG")
ENDIF(USE_PNG)

# Build flags
set(CMAKE_C_FLAGS "${CORE_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${CORE_FLAGS} -ggdb -DDEBUGMODE -Werror -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CORE_FLAGS} -g -O2")
set(CMAKE_C_FLAGS_RELEASE "${CORE_FLAGS} -O2")
set(CMAKE_C_FLAGS_MINSIZEREL "${CORE_FLAGS} -Os")

# Only strip on GCC (clang does not appreciate)<commit_msg>Disable SERVER_ONLY flag for now.<commit_after>cmake_minimum_required(VERSION 2.6)
project(OpenOMF C)

SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake-scripts)
find_package(SDL2)
find_package(shadowdive)
find_package(enet)
find_package(dumb)
find_package(OpenAL)
find_package(confuse)

# These flags are used for all builds
set(CORE_FLAGS "-Wall")

# Check available compiler
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
    if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
        set(CORE_FLAGS "${CORE_FLAGS} -std=c99")
    elseif(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
        message(FATAL_ERROR "GCC version must be at least 4.6!")
    else()
        set(CORE_FLAGS "${CORE_FLAGS} -std=c11")
    endif()
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
    set(CORE_FLAGS "${CORE_FLAGS} -std=c11")
    # On travis CMAKE_C_COMPILER_VERSION returns an empty string!
    if("${CMAKE_C_COMPILER_VERSION}" STREQUAL "")
        message(WARNING "Could not determine the version of your Clang compiler")
    else()
        if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.2)
            message(FATAL_ERROR "Clang version must be at least 3.2!")
        endif()
    endif()
else()
    set(CORE_FLAGS "${CORE_FLAGS} -std=c11")
    message(WARNING "Unsupported compiler!")
endif()

# When building with MingW, do not look for Libintl
# Also, use static libgcc when on mingw
IF(MINGW)
    set(LIBINTL_INCLUDE_DIR "")
    set(LIBINTL_LIBRARIES "")
    set(CORE_FLAGS "${CORE_FLAGS} -static-libgcc")
ELSE(MINGW)
    find_package(Libintl)
ENDIF(MINGW)

# Options
OPTION(USE_OGGVORBIS "Add support for Ogg Vorbis audio" OFF)
OPTION(USE_PNG "Add support for PNG screenshots" OFF)
#OPTION(SERVER_ONLY "Do not build the game binary" OFF)

# If we want to build support for vorbis streaming, find these too
IF(USE_OGGVORBIS)
    find_package(ogg)
    find_package(vorbis)
    set(CORE_FLAGS "${CORE_FLAGS} -DUSE_OGGVORBIS")
ENDIF(USE_OGGVORBIS)

IF(USE_PNG)
    find_package(PNG)
    find_package(ZLIB)
    set(CORE_FLAGS "${CORE_FLAGS} -DUSE_PNG")
ENDIF(USE_PNG)

# Build flags
set(CMAKE_C_FLAGS "${CORE_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${CORE_FLAGS} -ggdb -DDEBUGMODE -Werror -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CORE_FLAGS} -g -O2")
set(CMAKE_C_FLAGS_RELEASE "${CORE_FLAGS} -O2")
set(CMAKE_C_FLAGS_MINSIZEREL "${CORE_FLAGS} -Os")

# Only strip on GCC (clang does not appreciate)
{'fraction_non_alphanumeric': 0.1096815017928707, 'fraction_numerical': 0.009702594389369332, 'mean_word_length': 5.017766497461929, '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': '4460624', 'n_tokens_mistral': 1867, 'n_tokens_neox': 1795, 'n_words': 401}