add macro for lua 5.4 backwards compatibility so we can compile against lua 5.4 or 5.5
This commit is contained in:
parent
bcc2d410a7
commit
1ceb8a750b
|
|
@ -17,16 +17,23 @@ set(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed -ldl")
|
||||||
set(LIBUSB_INCLUDE_DIR /usr/include/libusb-1.0)
|
set(LIBUSB_INCLUDE_DIR /usr/include/libusb-1.0)
|
||||||
set(LIBXML_INCLUDE_DIR /usr/include/libxml2)
|
set(LIBXML_INCLUDE_DIR /usr/include/libxml2)
|
||||||
|
|
||||||
FIND_PACKAGE(Lua REQUIRED 5.4)
|
FIND_PACKAGE(Lua)
|
||||||
if(Lua_FOUND AND NOT TARGET Lua::Lua)
|
#FIND_PACKAGE(Lua 5.4 REQUIRED EXACT)
|
||||||
add_library(Lua::Lua INTERFACE IMPORTED)
|
#if(Lua_FOUND AND NOT TARGET Lua::Lua)
|
||||||
set_target_properties(
|
# add_library(Lua::Lua INTERFACE IMPORTED)
|
||||||
Lua::Lua
|
# set_target_properties(
|
||||||
PROPERTIES
|
# Lua::Lua
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
|
# PROPERTIES
|
||||||
INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
|
# INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
|
||||||
)
|
# INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
#endif()
|
||||||
message("Lua ${Lua_VERSION} found")
|
message("Lua ${Lua_VERSION} found")
|
||||||
|
if (Lua_VERSION VERSION_GREATER_EQUAL "5.5.0")
|
||||||
|
add_compile_definitions(USE_LUA_55)
|
||||||
|
else()
|
||||||
|
remove_definitions(USE_LUA_55)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h
|
#FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h
|
||||||
|
|
@ -66,7 +73,7 @@ endif()
|
||||||
|
|
||||||
message("Using pulseaudio backend...")
|
message("Using pulseaudio backend...")
|
||||||
add_compile_definitions(USE_PULSEAUDIO=true)
|
add_compile_definitions(USE_PULSEAUDIO=true)
|
||||||
target_link_libraries(monocoque m hidapi-hidraw pulse serialport xml2 argtable2 config gameloop helper devices slog simulatorapi uv xdg-basedir lua5.4 proc2)
|
target_link_libraries(monocoque m hidapi-hidraw pulse serialport xml2 argtable2 config gameloop helper devices slog simulatorapi uv xdg-basedir lua proc2)
|
||||||
|
|
||||||
target_include_directories(monocoque PUBLIC config ${LIBXML_INCLUDE_DIR} ${LUA_INCLUDE_DIR})
|
target_include_directories(monocoque PUBLIC config ${LIBXML_INCLUDE_DIR} ${LUA_INCLUDE_DIR})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,13 @@
|
||||||
#define _ARDUINOLEDLUA_H
|
#define _ARDUINOLEDLUA_H
|
||||||
|
|
||||||
//#include <lua.h>
|
//#include <lua.h>
|
||||||
#include <lua5.4/lauxlib.h>
|
#include <lauxlib.h>
|
||||||
#include <lua5.4/lualib.h>
|
#include <lualib.h>
|
||||||
|
|
||||||
|
#ifdef USE_LUA_55
|
||||||
|
/* open all libraries */
|
||||||
|
#define luaL_openlibs(L) luaL_openselectedlibs(L, ~0, 0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../simulatorapi/simapi/simapi/simdata.h"
|
#include "../../simulatorapi/simapi/simapi/simdata.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <hidapi/hidapi.h>
|
#include <hidapi/hidapi.h>
|
||||||
|
|
||||||
#include <lua5.4/lua.h>
|
#include <lua.h>
|
||||||
|
|
||||||
#include "usbdevice.h"
|
#include "usbdevice.h"
|
||||||
#include "sounddevice.h"
|
#include "sounddevice.h"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue