*/}}
瀏覽代碼

luajit modifications

YimingWu 1 年之前
父節點
當前提交
a2f4f6df76
共有 3 個文件被更改,包括 3 次插入54 次删除
  1. 0 1
      CMakeLists.txt
  2. 0 53
      FindLuaJIT.cmake
  3. 3 0
      luajit.c

+ 0 - 1
CMakeLists.txt

@@ -4,7 +4,6 @@ project(demo)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
 
 find_package(lagui REQUIRED)
-find_package(LuaJIT OPTIONAL_COMPONENTS)
 
 add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
 add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

+ 0 - 53
FindLuaJIT.cmake

@@ -1,53 +0,0 @@
-# Locate LuaJIT library
-# This module defines
-#  LUAJIT_FOUND, if false, do not try to link to Lua
-#  LUA_LIBRARY, where to find the lua library
-#  LUA_INCLUDE_DIR, where to find lua.h
-#
-# This module is similar to FindLua51.cmake except that it finds LuaJit instead.
-
-FIND_PATH(LUA_INCLUDE_DIR luajit.h
-	HINTS
-	$ENV{LUA_DIR}
-	PATH_SUFFIXES include/luajit-2.1 include/luajit-2.0 include/luajit-5_1-2.1 include/luajit-5_1-2.0 include luajit
-	PATHS
-	~/Library/Frameworks
-	/Library/Frameworks
-	/sw # Fink
-	/opt/local # DarwinPorts
-	/opt/csw # Blastwave
-	/opt
-)
-
-# Test if running on vcpkg toolchain
-if(DEFINED VCPKG_TARGET_TRIPLET AND DEFINED VCPKG_APPLOCAL_DEPS)
-	# On vcpkg luajit is 'lua51' and normal lua is 'lua'
-	FIND_LIBRARY(LUA_LIBRARY
-		NAMES lua51
-		HINTS
-		$ENV{LUA_DIR}
-		PATH_SUFFIXES lib
-	)
-else()
-	FIND_LIBRARY(LUA_LIBRARY
-		NAMES luajit-5.1
-		HINTS
-		$ENV{LUA_DIR}
-		PATH_SUFFIXES lib64 lib
-		PATHS
-		~/Library/Frameworks
-		/Library/Frameworks
-		/sw
-		/opt/local
-		/opt/csw
-		/opt
-	)
-endif()
-
-INCLUDE(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
-# all listed variables exist
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT
-	REQUIRED_VARS LUA_LIBRARY LUA_INCLUDE_DIR)
-
-MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARY)

+ 3 - 0
luajit.c

@@ -18,6 +18,8 @@
 
 #include "la_5.h"
 
+#define luajit_c
+
 #include "lua.h"
 #include "lauxlib.h"
 #include "lualib.h"
@@ -99,6 +101,7 @@ int INV_RunCode(laOperator* a, laEvent* e){
 }
 
 int main(int argc, char *argv[]){
+
     laGetReady();
 
     transSetLanguage("zh-CN");