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

enable_testing()

if(${USE_LLVM_BACKEND})
	find_package(LLVM REQUIRED CONFIG)
	
	include_directories(${LLVM_INCLUDE_DIRS})
	add_definitions(${LLVM_DEFINITIONS})
	add_definitions("-DUSE_LLVM_BACKEND")
endif()

if(MSVC)
	# Set flags for exception handling
	SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
	
	# Force to always compile with W4
	if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
		string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
	else()
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
	endif()
	
	# Disabling exception handling warning
	add_definitions(
		-wd4530 # Suppress 'warning C4530: C++ exception handler used, but unwind semantics are not enabled.'
	)
else()
	# Set flag for C++14
	set (CMAKE_CXX_FLAGS "-std=c++14" CACHE STRING "" FORCE)
	
	# Set flags for warnings
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")
	
	# Set flags for code coverage or sanitizers
    if(($ENV{COVERAGE}) AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
        message("Adding flags for code coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
        set(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
    elseif(($ENV{SANITIZE}) AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
        message("Adding flags for code coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")<commit_msg>Minor update to the main CMakelist<commit_after>cmake_minimum_required (VERSION 2.8)
project (TosLang)

enable_testing()

if(${USE_LLVM_BACKEND})
	find_package(LLVM REQUIRED CONFIG)
	
	include_directories(${LLVM_INCLUDE_DIRS})
	add_definitions(${LLVM_DEFINITIONS})
	add_definitions("-DUSE_LLVM_BACKEND")
endif()

if(MSVC)
	# Set flags for exception handling
	SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
	
	# Force to always compile with W4
	if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
		string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
	else()
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
	endif()
	
	# Disabling exception handling warning
	add_definitions(
		-wd4530 # Suppress 'warning C4530: C++ exception handler used, but unwind semantics are not enabled.'
	)
else()
	# Set flag for C++17
	set (CMAKE_CXX_FLAGS "-std=c++1z" CACHE STRING "" FORCE)
	
	# Set flags for warnings
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")
	
	# Set flags for code coverage or sanitizers
    if(($ENV{COVERAGE}) AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU"))
        message("Adding flags for code coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
        set(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
    elseif(($ENV{SANITIZE}) AND (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
        message("Adding flags for code coverage")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
{'fraction_non_alphanumeric': 0.12975778546712802, 'fraction_numerical': 0.012975778546712802, 'mean_word_length': 4.820469798657718, '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': '5471986', 'n_tokens_mistral': 1464, 'n_tokens_neox': 1295, 'n_words': 272}