<commit_before>cmake_minimum_required(VERSION 2.8)

project(serialization)

option(SZN_NO_CPP11 "Disable use of C++11 if available for the compiler" OFF)
if(SZN_NO_CPP11)
	add_definitions("-DSZN_NO_CPP11")
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
	message(STATUS "Using GCC")

	#enable many useful warnings
	set(flags "-Wall")

	#check usage of printf-like functions
	set(flags "${flags} -Wformat-security")

	#warn about implicit conversions
	set(flags "${flags} -Wconversion")

	#some more warnings (which are not always useful)
	set(flags "${flags} -Wextra")

	#extra strictness
	set(flags "${flags} -pedantic")

	if(UNIX)
		set(flags "${flags} -pthread")
	endif()

	if(MINGW)
		#otherwise MinGW complains about undeclared "swprintf"
		if(SZN_NO_CPP11)
			set(flags "${flags} -std=gnu++03")
		else()
			set(flags "${flags} -std=gnu++11")
		endif()

		#enable security features (DEP, ASLR)
		#they seem to be disabled by default on MinGW
		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
	else()
		if(NOT SZN_NO_CPP11)
			execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
							OUTPUT_VARIABLE GCC_VERSION)
			if(GCC_VERSION VERSION_LESS 4.3)
				set(SZN_NO_CPP11 ON)
			endif()
		endif()

		if(SZN_NO_CPP11)
			set(flags "${flags} -std=c++03")
		else()
			set(flags "${flags} -std=c++0x")
			message(STATUS "C++0x enabled")
		endif()
	endif()

	list(APPEND CMAKE_CXX_FLAGS ${flags})
endif()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
	message(STATUS "Using Clang")
	set(flags "-Wall -pedantic -fmacro-backtrace-limit=0")
	if(SZN_CPP11)
		set(flags "${flags} -std=c++11")
	endif()
	set(CMAKE_CXX_FLAGS ${flags})
endif()

if(MSVC)
	#disable warnings about deprecation
	set(flags "/wd4996")

	#enable concurrency<commit_msg>fix C++11 option for Clang<commit_after>cmake_minimum_required(VERSION 2.8)

project(serialization)

option(SZN_NO_CPP11 "Disable use of C++11 if available for the compiler" OFF)
if(SZN_NO_CPP11)
	add_definitions("-DSZN_NO_CPP11")
endif()

if(CMAKE_COMPILER_IS_GNUCXX)
	message(STATUS "Using GCC")

	#enable many useful warnings
	set(flags "-Wall")

	#check usage of printf-like functions
	set(flags "${flags} -Wformat-security")

	#warn about implicit conversions
	set(flags "${flags} -Wconversion")

	#some more warnings (which are not always useful)
	set(flags "${flags} -Wextra")

	#extra strictness
	set(flags "${flags} -pedantic")

	if(UNIX)
		set(flags "${flags} -pthread")
	endif()

	if(MINGW)
		#otherwise MinGW complains about undeclared "swprintf"
		if(SZN_NO_CPP11)
			set(flags "${flags} -std=gnu++03")
		else()
			set(flags "${flags} -std=gnu++11")
		endif()

		#enable security features (DEP, ASLR)
		#they seem to be disabled by default on MinGW
		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
	else()
		if(NOT SZN_NO_CPP11)
			execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
							OUTPUT_VARIABLE GCC_VERSION)
			if(GCC_VERSION VERSION_LESS 4.3)
				set(SZN_NO_CPP11 ON)
			endif()
		endif()

		if(SZN_NO_CPP11)
			set(flags "${flags} -std=c++03")
		else()
			set(flags "${flags} -std=c++0x")
			message(STATUS "C++0x enabled")
		endif()
	endif()

	list(APPEND CMAKE_CXX_FLAGS ${flags})
endif()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
	message(STATUS "Using Clang")
	set(flags "-Wall -pedantic -fmacro-backtrace-limit=0")
	if(NOT SZN_NO_CPP11)
		set(flags "${flags} -std=c++11")
	endif()
	set(CMAKE_CXX_FLAGS ${flags})
endif()

if(MSVC)
	#disable warnings about deprecation
	set(flags "/wd4996")

	#enable concurrency
{'fraction_non_alphanumeric': 0.1438969764837626, 'fraction_numerical': 0.02127659574468085, 'mean_word_length': 5.118150684931507, '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': '763883', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1361, 'n_words': 316}