<commit_before>include (LibAddBinding)

if (DEPENDENCY_PHASE)
	set (LUA_REQUIRED_VERSION 5.1)
	find_package(Lua ${LUA_REQUIRED_VERSION} QUIET)
	find_swig()

	if (LUA_FOUND AND SWIG_FOUND)
		include (LibAddMacros)

		add_custom_command (OUTPUT runtime.h
			COMMAND ${SWIG_EXECUTABLE} -c++ -lua -external-runtime runtime.h
		)

		# we call this SWIG_COMPILE_FLAGS because we have the same variable in our swig bindings
		set (SWIG_COMPILE_FLAGS "-Wno-shadow -Wno-old-style-cast -Wno-unused-variable")
		set_source_files_properties (lua.cpp PROPERTIES COMPILE_FLAGS "${SWIG_COMPILE_FLAGS}")
	elseif (NOT LUA_FOUND)
		remove_plugin (lua "Lua libs (>= liblua${LUA_REQUIRED_VERSION}-dev) not found")
	else ()
		remove_plugin (lua "swig not found")<commit_msg>Lua Plugin: Require Lua bindings<commit_after>include (LibAddBinding)

if (DEPENDENCY_PHASE)
	set (LUA_REQUIRED_VERSION 5.1)
	find_package(Lua ${LUA_REQUIRED_VERSION} QUIET)
	find_swig()
	check_binding_included ("swig_lua" BINDING_WAS_ADDED SUBDIRECTORY "swig/lua" SILENT)

	if (LUA_FOUND AND SWIG_FOUND AND BINDING_WAS_ADDED)
		include (LibAddMacros)

		add_custom_command (OUTPUT runtime.h
			COMMAND ${SWIG_EXECUTABLE} -c++ -lua -external-runtime runtime.h
		)

		# we call this SWIG_COMPILE_FLAGS because we have the same variable in our swig bindings
		set (SWIG_COMPILE_FLAGS "-Wno-shadow -Wno-old-style-cast -Wno-unused-variable")
		set_source_files_properties (lua.cpp PROPERTIES COMPILE_FLAGS "${SWIG_COMPILE_FLAGS}")
	elseif (NOT LUA_FOUND)
		remove_plugin (lua "Lua libs (>= liblua${LUA_REQUIRED_VERSION}-dev) not found")
	elseif (NOT BINDING_WAS_ADDED)
		remove_plugin (lua "swig_lua binding is required")
	else ()
		remove_plugin (lua "swig not found")
{'fraction_non_alphanumeric': 0.09662398137369034, 'fraction_numerical': 0.002328288707799767, 'mean_word_length': 5.637065637065637, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3493204', 'n_tokens_mistral': 671, 'n_tokens_neox': 660, 'n_words': 152}