<commit_before>cmake_minimum_required(VERSION 3.2)
project(anitomy_lib)

if(UNIX)
  if(APPLE)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -mmacosx-version-min=10.7")
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
  endif(APPLE)

  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++11 -Wall -Wextra -Wpedantic -Werror")
  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
else(UNIX)
  if(MSVC)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
  endif(MSVC)
endif(UNIX)

if(NOT NODE_ANITOMY_USE_BOOST)
  try_compile(CAN_USE_CODECVT "${CMAKE_CURRENT_BINARY_DIR}/compiler_tests" "${CMAKE_CURRENT_SOURCE_DIR}/compiler_tests/codecvt_test.cpp")
  if(NOT CAN_USE_CODECVT)
    message(WARNING "<codecvt> not available, automatically enabling boost-lib")
    set(NODE_ANITOMY_USE_BOOST ON)
  endif()
endif()

if(NODE_ANITOMY_USE_BOOST)
  set(NODE_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/node_modules")
  
  if(NOT IS_DIRECTORY "${NODE_MODULES_DIR}")
    get_filename_component(PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY)
    get_filename_component(PARENT_DIR_NAME "${PARENT_DIR}" NAME)
    if(PARENT_DIR_NAME STREQUAL "node_modules")
      set(NODE_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
    endif()
  endif()
  
  if(NOT EXISTS "${NODE_MODULES_DIR}/boost-lib/cmake/BoostLib.cmake")
    message(FATAL_ERROR "Couldn't find boost-lib cmake file")
  endif()

  set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${NODE_MODULES_DIR}/boost-lib/cmake")
  
  include(BoostLib) <commit_msg>Re-add /WX on windows, as all warnings should be fixed<commit_after>cmake_minimum_required(VERSION 3.2)
project(anitomy_lib)

if(UNIX)
  if(APPLE)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -mmacosx-version-min=10.7")
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
  endif(APPLE)

  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++11 -Wall -Wextra -Wpedantic -Werror")
  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
else(UNIX)
  if(MSVC)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /MP")
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
  endif(MSVC)
endif(UNIX)

if(NOT NODE_ANITOMY_USE_BOOST)
  try_compile(CAN_USE_CODECVT "${CMAKE_CURRENT_BINARY_DIR}/compiler_tests" "${CMAKE_CURRENT_SOURCE_DIR}/compiler_tests/codecvt_test.cpp")
  if(NOT CAN_USE_CODECVT)
    message(WARNING "<codecvt> not available, automatically enabling boost-lib")
    set(NODE_ANITOMY_USE_BOOST ON)
  endif()
endif()

if(NODE_ANITOMY_USE_BOOST)
  set(NODE_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/node_modules")
  
  if(NOT IS_DIRECTORY "${NODE_MODULES_DIR}")
    get_filename_component(PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY)
    get_filename_component(PARENT_DIR_NAME "${PARENT_DIR}" NAME)
    if(PARENT_DIR_NAME STREQUAL "node_modules")
      set(NODE_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
    endif()
  endif()
  
  if(NOT EXISTS "${NODE_MODULES_DIR}/boost-lib/cmake/BoostLib.cmake")
    message(FATAL_ERROR "Couldn't find boost-lib cmake file")
  endif()

  set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${NODE_MODULES_DIR}/boost-lib/cmake")
  
  include(BoostLib) 
{'fraction_non_alphanumeric': 0.12894064186310708, 'fraction_numerical': 0.005680204487361545, 'mean_word_length': 6.430379746835443, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '861642', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1410, 'n_words': 192}