<commit_before>cmake_minimum_required (VERSION 3.0)

project(pyext CXX)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
if(COMPILER_SUPPORTS_CXX14)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else()
    message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -pthread")

include_directories(pyext inc)
add_library(pyext SHARED src/pyext.cpp src/core.cpp src/utils.cpp src/sandbox.cpp src/ev.cpp)
target_link_libraries(pyext rt cgroup)
<commit_msg>Harden compile options<commit_after>cmake_minimum_required (VERSION 3.0)

project(pyext CXX)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
if(COMPILER_SUPPORTS_CXX14)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else()
    message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -Wall -Wextra -Wno-unused-parameter -fvisibility=hidden -fstack-protector-all -fPIE -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now")

include_directories(pyext inc)
add_library(pyext SHARED src/pyext.cpp src/core.cpp src/utils.cpp src/sandbox.cpp src/ev.cpp)
target_link_libraries(pyext rt cgroup)

{'fraction_non_alphanumeric': 0.12073863636363637, 'fraction_numerical': 0.019176136363636364, 'mean_word_length': 6.7845303867403315, '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': '5780694', 'n_tokens_mistral': 577, 'n_tokens_neox': 542, 'n_words': 103}