<commit_before>
include_directories(${PROJECT_SOURCE_DIR})
# OS依存ファイルのマクロ設定
if(${WIN32})
	add_definitions(-DWIN32)
	set(TOOL_PREFIX mingw)
elseif(${UNIX})
	add_definitions(-DUNIX)
	set(TOOL_PREFIX deb)
else()
	message(FATAL_ERROR "couldn't detect OS type")
endif()

# Use SSE instructions
# set(SSE_LEVEL 2)
# Use NEON instructions
# set(NEON_LEVEL 1)

if(DEFINED SSE_LEVEL)
	if(${SSE_LEVEL} GREATER 0)
		add_definitions(-DSSE_LEVEL=${SSE_LEVEL})
		set(DEPEND_CFLAG "${DEPEND_CFLAG} -msse2")
		message(STATUS "configured as to using SSE-" ${SSE_LEVEL} " instructions...")
	endif()
elseif(DEFINED NEON_LEVEL)
	if(${NEON_LEVEL} GREATER 0)
		add_definitions(-DNEON_LEVEL=${NEON_LEVEL})
		set(DEPEND_CFLAG "${DEPEND_CFLAG} -mfpu=neon")
		message(STATUS "configured as to using NEON-" ${NEON_LEVEL} " instructions...")
	endif()
endif()

if(DEFINED ARCHITECTURE)
	set(BOOST_PATH /usr/local/src/boost_1_54_0)
	set(ANDROID_NDK_ROOT "/usr/local/adt-bundle-linux-x86/ndk")
	set(ANDROID_PLATFORM "linux-x86")
	set(ANDROID_VER "9")

	if(ARCHITECTURE STREQUAL "x86")
		set(TOOL_PREFIX x86)
		set(ANDROID_PREF "i686-linux-android")
		set(ANDROID_ARCH "x86")
		set(ANDROID_TOOLCHAIN "x86")
		set(DEPEND_CFLAG "${DEPEND_CFLAG} --sysroot=${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-x86")

		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEPEND_CFLAG} -ffunction-sections -funwind-tables -no-canonical-prefixes -fstack-protector")
		set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -UNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing")
		set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -DNDEBUG -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300")
	elseif(ARCHITECTURE STREQUAL "arm")
		set(TOOL_PREFIX arm)
		set(ANDROID_PREF "arm-linux-androideabi")
		set(ANDROID_ARCH "armeabi")
		set(ANDROID_TOOLCHAIN "arm-linux-androideabi")
		set(DEPEND_CFLAG "${DEPEND_CFLAG} -march=armv7 -mthumb --sysroot=${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-arm")
		add_definitions(-D__arm__)

		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEPEND_CFLAG} -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes")
		if(AS_ARM)
			set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -UNDEBUG -marm -fno-omit-frame-pointer -fno-strict-aliasing")
			set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -DNDEBUG -marm -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300")
		else()
			set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS_DEBUG} -O0 -UNDEBUG -mthumb -fno-omit-frame-pointer")
			set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mthumb -Os -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64")
		endif()
	else()
		message(FATAL_ERROR, "unknown architecture")
	endif()

	include_directories(${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/include
						${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/${ANDROID_ARCH}/include
						${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-${ANDROID_ARCH}/usr/include
						${BOOST_PATH}
						${PROJECT_SOURCE_DIR})
	link_directories(${BOOST_PATH}/android_${ARCHITECTURE}/lib
					${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/${ANDROID_ARCH}
					${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-${ANDROID_ARCH}/usr/lib)
	add_definitions(-DANDROID
					-D__ANDROID__
					-DGLIBC
					-D_GLIBCPP_USE_WCHAR_T
					-D_LITTLE_ENDIAN
					-DNDEBUG
					-DPAGE_SIZE=2048
					-D_REENTRANT)

	set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -std=c++11")
	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -ggdb3 -O0 -fno-strict-aliasing")
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE} -O2")

	set(LDFLAGS "-no-canonical-prefixes")
	set(CMAKE_MODULE_LINKER_FLAGS ${LDFLAGS})
	set(CMAKE_SHARED_LINKER_FLAGS ${LDFLAGS})
	set(CMAKE_EXE_LINKER_FLAGS ${LDFLAGS})
else()
	set(CMAKE_C_FLAGS ${DEPEND_CFLAG})
	# MinGW環境でのデバッグはしないのでgフラグは付けない
	if(${UNIX})
		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb3")
	endif()
	set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
	set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -O0")
	set(CMAKE_CXX_FLAGS_RELEASE "-O2")
endif()<commit_msg>cmake: デバッグ時のコンパイラフラグ修正<commit_after>
include_directories(${PROJECT_SOURCE_DIR})
# OS依存ファイルのマクロ設定
if(${WIN32})
	add_definitions(-DWIN32)
	set(TOOL_PREFIX mingw)
elseif(${UNIX})
	add_definitions(-DUNIX)
	set(TOOL_PREFIX deb)
else()
	message(FATAL_ERROR "couldn't detect OS type")
endif()

# Use SSE instructions
# set(SSE_LEVEL 2)
# Use NEON instructions
# set(NEON_LEVEL 1)

if(DEFINED SSE_LEVEL)
	if(${SSE_LEVEL} GREATER 0)
		add_definitions(-DSSE_LEVEL=${SSE_LEVEL})
		set(DEPEND_CFLAG "${DEPEND_CFLAG} -msse2")
		message(STATUS "configured as to using SSE-" ${SSE_LEVEL} " instructions...")
	endif()
elseif(DEFINED NEON_LEVEL)
	if(${NEON_LEVEL} GREATER 0)
		add_definitions(-DNEON_LEVEL=${NEON_LEVEL})
		set(DEPEND_CFLAG "${DEPEND_CFLAG} -mfpu=neon")
		message(STATUS "configured as to using NEON-" ${NEON_LEVEL} " instructions...")
	endif()
endif()

if(DEFINED ARCHITECTURE)
	set(BOOST_PATH /usr/local/src/boost_1_54_0)
	set(ANDROID_NDK_ROOT "/usr/local/adt-bundle-linux-x86/ndk")
	set(ANDROID_PLATFORM "linux-x86")
	set(ANDROID_VER "9")

	if(ARCHITECTURE STREQUAL "x86")
		set(TOOL_PREFIX x86)
		set(ANDROID_PREF "i686-linux-android")
		set(ANDROID_ARCH "x86")
		set(ANDROID_TOOLCHAIN "x86")
		set(DEPEND_CFLAG "${DEPEND_CFLAG} --sysroot=${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-x86")

		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEPEND_CFLAG} -ffunction-sections -funwind-tables -no-canonical-prefixes -fstack-protector")
		set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -UNDEBUG -fno-omit-frame-pointer -fno-strict-aliasing")
		set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -DNDEBUG -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300")
	elseif(ARCHITECTURE STREQUAL "arm")
		set(TOOL_PREFIX arm)
		set(ANDROID_PREF "arm-linux-androideabi")
		set(ANDROID_ARCH "armeabi")
		set(ANDROID_TOOLCHAIN "arm-linux-androideabi")
		set(DEPEND_CFLAG "${DEPEND_CFLAG} -march=armv7 -mthumb --sysroot=${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-arm")
		add_definitions(-D__arm__)

		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEPEND_CFLAG} -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes")
		if(AS_ARM)
			set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -UNDEBUG -marm -fno-omit-frame-pointer -fno-strict-aliasing")
			set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -DNDEBUG -marm -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300")
		else()
			set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS_DEBUG} -O0 -UNDEBUG -mthumb -fno-omit-frame-pointer")
			set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mthumb -Os -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64")
		endif()
	else()
		message(FATAL_ERROR, "unknown architecture")
	endif()

	include_directories(${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/include
						${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/${ANDROID_ARCH}/include
						${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-${ANDROID_ARCH}/usr/include
						${BOOST_PATH}
						${PROJECT_SOURCE_DIR})
	link_directories(${BOOST_PATH}/android_${ARCHITECTURE}/lib
					${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.8/libs/${ANDROID_ARCH}
					${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_VER}/arch-${ANDROID_ARCH}/usr/lib)
	add_definitions(-DANDROID
					-D__ANDROID__
					-DGLIBC
					-D_GLIBCPP_USE_WCHAR_T
					-D_LITTLE_ENDIAN
					-DNDEBUG
					-DPAGE_SIZE=2048
					-D_REENTRANT)

	set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -std=c++11")
	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -ggdb3 -O0 -fno-strict-aliasing")
	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE} -O2")

	set(LDFLAGS "-no-canonical-prefixes")
	set(CMAKE_MODULE_LINKER_FLAGS ${LDFLAGS})
	set(CMAKE_SHARED_LINKER_FLAGS ${LDFLAGS})
	set(CMAKE_EXE_LINKER_FLAGS ${LDFLAGS})
else()
	set(CMAKE_C_FLAGS ${DEPEND_CFLAG})
	# MinGW環境でのデバッグはしないのでgフラグは付けない
	if(${UNIX})
		set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb3")
	endif()
	set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -O0")
	set(CMAKE_CXX_FLAGS_RELEASE "-O2")
endif()
{'fraction_non_alphanumeric': 0.14694454256446485, 'fraction_numerical': 0.015306723183798422, 'mean_word_length': 5.9565929565929565, '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': '6367094', 'n_tokens_mistral': 4015, 'n_tokens_neox': 3606, 'n_words': 463}