<commit_before># g3log is a KjellKod Logger
# 2015 @author <NAME>, <EMAIL>
# ==================================================================
# 2015 by KjellKod.cc. This is PUBLIC DOMAIN to use at your own
#    risk and comes  with no warranties.
#
# This code is yours to share, use and modify with no strings attached
#   and no restrictions or obligations.
# ===================================================================

# GENERIC STEPS
SET(LOG_SRC ${g3log_SOURCE_DIR}/src)

file(GLOB SRC_FILES  ${LOG_SRC}/*.cpp ${LOG_SRC}/*.ipp)
file(GLOB HEADER_FILES ${LOG_SRC}/g3log/*.hpp)

list( APPEND HEADER_FILES ${GENERATED_G3_DEFINITIONS} )
list( APPEND SRC_FILES ${GENERATED_G3_DEFINITIONS} )

IF (MSVC OR MINGW)
   list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_unix.cpp)
ELSE()
   list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_windows.cpp ${LOG_SRC}/g3log/stacktrace_windows.hpp ${LOG_SRC}/stacktrace_windows.cpp)
ENDIF (MSVC OR MINGW)

set(SRC_FILES ${SRC_FILES} ${SRC_PLATFORM_SPECIFIC})

# Create the g3log library
SET(G3LOG_LIBRARY g3log)


IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
    message("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
    IF( NOT CMAKE_INSTALL_PREFIX)
       SET(CMAKE_INSTALL_PREFIX /usr/local)
    ENDIF()

    set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
    set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
    message("Install rpath location: ${CMAKE_INSTALL_RPATH}")
ENDIF()

IF( G3_SHARED_LIB )
   IF( WIN32 )
      IF(NOT(${CMAKE_VERSION} VERSION_LESS "3.4"))
         set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
      ELSE()
         message( FATAL_ERROR "Need CMake version >=3.4 to build shared windows library!" )
      ENDIF()
   ENDIF()
   ADD_LIBRARY(${G3LOG_LIBRARY} SHARED ${SRC_FILES})
ELSE()
   IF(MSVC)
   IF(NOT G3_SHARED_RUNTIME)
         SET(CompilerFlags
               CMAKE_CXX_FLAGS
               CMAKE_CXX_FLAGS_DEBUG
               CMAKE_CXX_FLAGS_RELEASE
               CMAKE_C_FLAGS
               CMAKE_C_FLAGS_DEBUG
               CMAKE_C_FLAGS_RELEASE
            )
         foreach(CompilerFlag ${CompilerFlags})
            string(REPLACE "/MDd" "/MTd" ${CompilerFlag} "${${CompilerFlag}}")
            string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
         endforeach()
      ENDIF()
   ENDIF()
   ADD_LIBRARY(${G3LOG_LIBRARY} STATIC ${SRC_FILES})
ENDIF()

SET(${G3LOG_LIBRARY}_VERSION_STRING ${VERSION})
MESSAGE( STATUS "Creating ${G3LOG_LIBRARY} VERSION: ${VERSION}" )

SET_TARGET_PROPERTIES(${G3LOG_LIBRARY} PROPERTIES
   LINKER_LANGUAGE CXX
   OUTPUT_NAME g3log
   CLEAN_DIRECT_OUTPUT 1
   SOVERSION ${MAJOR_VERSION}
   )

IF(APPLE)
SET_TARGET_PROPERTIES(${G3LOG_LIBRARY} PROPERTIES MACOSX_RPATH TRUE)
ENDIF()

# require here some proxy for c++14 standard to avoid problems TARGET_PROPERTY CXX_STANDARD
TARGET_COMPILE_FEATURES(${G3LOG_LIBRARY} PUBLIC cxx_variable_templates)

TARGET_INCLUDE_DIRECTORIES(${G3LOG_LIBRARY}
   PUBLIC
      $<BUILD_INTERFACE:${LOG_SRC}>
      $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)

SET(ACTIVE_CPP0xx_DIR "Release")

# find corresponding thread lib (e.g. whether -lpthread is needed or not)
FIND_PACKAGE(Threads REQUIRED)
TARGET_LINK_LIBRARIES(${G3LOG_LIBRARY} Threads::Threads )

# check for backtrace and cxa_demangle only in non-Windows dev environments<commit_msg>fix version (#404)<commit_after># g3log is a KjellKod Logger
# 2015 @author <NAME>, <EMAIL>
# ==================================================================
# 2015 by KjellKod.cc. This is PUBLIC DOMAIN to use at your own
#    risk and comes  with no warranties.
#
# This code is yours to share, use and modify with no strings attached
#   and no restrictions or obligations.
# ===================================================================

# GENERIC STEPS
SET(LOG_SRC ${g3log_SOURCE_DIR}/src)

file(GLOB SRC_FILES  ${LOG_SRC}/*.cpp ${LOG_SRC}/*.ipp)
file(GLOB HEADER_FILES ${LOG_SRC}/g3log/*.hpp)

list( APPEND HEADER_FILES ${GENERATED_G3_DEFINITIONS} )
list( APPEND SRC_FILES ${GENERATED_G3_DEFINITIONS} )

IF (MSVC OR MINGW)
   list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_unix.cpp)
ELSE()
   list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_windows.cpp ${LOG_SRC}/g3log/stacktrace_windows.hpp ${LOG_SRC}/stacktrace_windows.cpp)
ENDIF (MSVC OR MINGW)

set(SRC_FILES ${SRC_FILES} ${SRC_PLATFORM_SPECIFIC})

# Create the g3log library
SET(G3LOG_LIBRARY g3log)


IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
    message("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
    IF( NOT CMAKE_INSTALL_PREFIX)
       SET(CMAKE_INSTALL_PREFIX /usr/local)
    ENDIF()

    set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
    set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
    message("Install rpath location: ${CMAKE_INSTALL_RPATH}")
ENDIF()

IF( G3_SHARED_LIB )
   IF( WIN32 )
      IF(NOT(${CMAKE_VERSION} VERSION_LESS "3.4"))
         set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
      ELSE()
         message( FATAL_ERROR "Need CMake version >=3.4 to build shared windows library!" )
      ENDIF()
   ENDIF()
   ADD_LIBRARY(${G3LOG_LIBRARY} SHARED ${SRC_FILES})
ELSE()
   IF(MSVC)
   IF(NOT G3_SHARED_RUNTIME)
         SET(CompilerFlags
               CMAKE_CXX_FLAGS
               CMAKE_CXX_FLAGS_DEBUG
               CMAKE_CXX_FLAGS_RELEASE
               CMAKE_C_FLAGS
               CMAKE_C_FLAGS_DEBUG
               CMAKE_C_FLAGS_RELEASE
            )
         foreach(CompilerFlag ${CompilerFlags})
            string(REPLACE "/MDd" "/MTd" ${CompilerFlag} "${${CompilerFlag}}")
            string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
         endforeach()
      ENDIF()
   ENDIF()
   ADD_LIBRARY(${G3LOG_LIBRARY} STATIC ${SRC_FILES})
ENDIF()

SET(${G3LOG_LIBRARY}_VERSION_STRING ${VERSION})
MESSAGE( STATUS "Creating ${G3LOG_LIBRARY} VERSION: ${VERSION}" )
MESSAGE( STATUS "Creating ${G3LOG_LIBRARY} SOVERSION: ${MAJOR_VERSION}" )

SET_TARGET_PROPERTIES(${G3LOG_LIBRARY} PROPERTIES
   LINKER_LANGUAGE CXX
   OUTPUT_NAME g3log
   CLEAN_DIRECT_OUTPUT 1
   SOVERSION ${MAJOR_VERSION}
   VERSION ${VERSION}
   )


IF(APPLE)
SET_TARGET_PROPERTIES(${G3LOG_LIBRARY} PROPERTIES MACOSX_RPATH TRUE)
ENDIF()

# require here some proxy for c++14 standard to avoid problems TARGET_PROPERTY CXX_STANDARD
TARGET_COMPILE_FEATURES(${G3LOG_LIBRARY} PUBLIC cxx_variable_templates)

TARGET_INCLUDE_DIRECTORIES(${G3LOG_LIBRARY}
   PUBLIC
      $<BUILD_INTERFACE:${LOG_SRC}>
      $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)

SET(ACTIVE_CPP0xx_DIR "Release")

# find corresponding thread lib (e.g. whether -lpthread is needed or not)
FIND_PACKAGE(Threads REQUIRED)
TARGET_LINK_LIBRARIES(${G3LOG_LIBRARY} Threads::Threads )

# check for backtrace and cxa_demangle only in non-Windows dev environments
{'fraction_non_alphanumeric': 0.14131079478054567, 'fraction_numerical': 0.012158956109134046, 'mean_word_length': 4.50163132137031, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '7002011', 'n_tokens_mistral': 2556, 'n_tokens_neox': 2349, 'n_words': 483}