<commit_before>include (${SWIG_USE_FILE})
include (LibAddMacros)

find_package (Lua 5.1 QUIET)

if (NOT LUA_FOUND)
	exclude_binding (swig_lua "Lua libs >= 5.1 not found")
else ()
	add_binding (swig_lua)

	add_headers (HDR_FILES)
	add_cppheaders (HDR_FILES)

	include_directories (${LUA_INCLUDE_DIR})
	include_directories (${CMAKE_CURRENT_SOURCE_DIR})

	set (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}")
	set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SWIG_OUTDIR}")
	set (CMAKE_SWIG_FLAGS "-O")
<commit_msg>Lua: Disable binding if `BUILD_SHARED` is off<commit_after>include (${SWIG_USE_FILE})
include (LibAddMacros)

find_package (Lua 5.1 QUIET)

if (NOT LUA_FOUND)
	exclude_binding (swig_lua "Lua libs >= 5.1 not found")
else ()
	if (NOT BUILD_SHARED)
		exclude_binding (swig_lua "it can only be built if `BUILD_SHARED` is enabled")
		return ()
	endif (NOT BUILD_SHARED)

	add_binding (swig_lua)

	add_headers (HDR_FILES)
	add_cppheaders (HDR_FILES)

	include_directories (${LUA_INCLUDE_DIR})
	include_directories (${CMAKE_CURRENT_SOURCE_DIR})

	set (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}")
	set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SWIG_OUTDIR}")
	set (CMAKE_SWIG_FLAGS "-O")

{'fraction_non_alphanumeric': 0.11148365465213747, 'fraction_numerical': 0.006705783738474434, 'mean_word_length': 7.122448979591836, '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': '4921983', 'n_tokens_mistral': 519, 'n_tokens_neox': 484, 'n_words': 100}