chore(build): remove CheckLuaObjlen, it is easier to check the Lua version
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
b986af09ed
commit
0a6f622aec
3 changed files with 0 additions and 36 deletions
|
@ -127,9 +127,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I ${LUA_INCLUDE_DIR}")
|
||||||
if ("${HAS_LUA_NEWSTATE}$" MATCHES "TRUE")
|
if ("${HAS_LUA_NEWSTATE}$" MATCHES "TRUE")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D LEAN_USE_LUA_NEWSTATE")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D LEAN_USE_LUA_NEWSTATE")
|
||||||
endif()
|
endif()
|
||||||
if ("${HAS_LUA_OBJLEN}$" MATCHES "TRUE")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D LEAN_USE_LUA_OBJLEN")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(${LEAN_SOURCE_DIR})
|
include_directories(${LEAN_SOURCE_DIR})
|
||||||
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
||||||
Released under Apache 2.0 license as described in the file LICENSE.
|
|
||||||
|
|
||||||
Author: Leonardo de Moura
|
|
||||||
*/
|
|
||||||
#include <iostream>
|
|
||||||
#include <memory>
|
|
||||||
#include <lua.hpp>
|
|
||||||
|
|
||||||
// Little program for checking whether lua_objlen is available
|
|
||||||
int main() {
|
|
||||||
lua_State * L;
|
|
||||||
L = luaL_newstate();
|
|
||||||
lua_newtable(L);
|
|
||||||
if (lua_objlen(L, -1) == 0)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
}
|
|
|
@ -133,18 +133,5 @@ if (LUA_FOUND)
|
||||||
else()
|
else()
|
||||||
message(STATUS "lua_newstate is not supported by your Lua engine, Lean will not be able to track memory consumed by the Lua engine")
|
message(STATUS "lua_newstate is not supported by your Lua engine, Lean will not be able to track memory consumed by the Lua engine")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
try_run(LUA_CHECK2 LUA_CHECK_BUILD2
|
|
||||||
${LEAN_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
|
|
||||||
${LEAN_SOURCE_DIR}/cmake/Modules/CheckLuaObjlen.cc
|
|
||||||
CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${LUA_INCLUDE_DIR}
|
|
||||||
-DLINK_LIBRARIES=${LUA_LIBRARIES}
|
|
||||||
RUN_OUTPUT_VARIABLE LUA_TRY_OUT)
|
|
||||||
if ("${LUA_CHECK2}" MATCHES "0" AND "${LUA_CHECK_BUILD2}$" MATCHES "TRUE")
|
|
||||||
message(STATUS "lua_objlen found")
|
|
||||||
set(HAS_LUA_OBJLEN TRUE)
|
|
||||||
else()
|
|
||||||
message(STATUS "lua_objlen is not available, using lua_rawlen instead")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
Loading…
Reference in a new issue