aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindLua.cmake
blob: 479dfcf419852662ef1d60256e1f970640c9e9b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
mark_as_advanced(LUA_LIBRARY LUA_INCLUDE_DIR)
set(USE_LUAJIT FALSE)

if(ENABLE_LUAJIT)
	find_library(LUA_LIBRARY luajit
			NAMES luajit-5.1)
	find_path(LUA_INCLUDE_DIR luajit.h
		NAMES luajit.h
		PATH_SUFFIXES luajit-2.0)
	if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
		set(USE_LUAJIT TRUE)
	endif()
else()
	message (STATUS "LuaJIT detection disabled! (ENABLE_LUAJIT=0)")
endif()

if(NOT USE_LUAJIT)
	message(STATUS "LuaJIT not found, using bundled Lua.")
	set(LUA_LIBRARY "lua")
	set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
	add_subdirectory(lua)
endif()

class="hl opt">) if ! [ -z "$d" ]; then whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST") # If file is not whitelisted, mark a failure if [ -z "${whitelisted}" ]; then errorcount=$((errorcount+1)) printf "The file %s is not compliant with the coding style" "$f" if [ ${errorcount} -gt 50 ]; then printf "\nToo many errors encountered previously, this diff is hidden.\n" else printf ":\n%s\n" "$d" fi fail=1 fi fi done if [ "$fail" = 1 ]; then echo "LINT reports failure." exit 1 fi echo "LINT OK" } function fix_format() { echo "Fixing format..." setup_for_format for f in ${files_to_lint}; do whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST") if [ -z "${whitelisted}" ]; then echo "$f" $CLANG_FORMAT -i "$f" fi done }