Frankenstein some more

This commit is contained in:
Mm2PL 2023-01-30 17:00:30 +01:00
parent a6a84c89be
commit 82da817835
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9
8 changed files with 78 additions and 22 deletions

4
.gitmodules vendored
View file

@ -38,6 +38,6 @@
[submodule "lib/miniaudio"] [submodule "lib/miniaudio"]
path = lib/miniaudio path = lib/miniaudio
url = https://github.com/mackron/miniaudio.git url = https://github.com/mackron/miniaudio.git
[submodule "lib/lua"] [submodule "lib/lua/src"]
path = lib/lua path = lib/lua/src
url = https://github.com/lua/lua url = https://github.com/lua/lua

View file

@ -2,6 +2,7 @@
## Unversioned ## Unversioned
- Major: Add scripting capabilities with Lua (#4341)
- Major: Added live emote updates for BTTV (#4147) - Major: Added live emote updates for BTTV (#4147)
- Minor: Change the highlight order to prioritize Message highlights over User highlights. (#4303) - Minor: Change the highlight order to prioritize Message highlights over User highlights. (#4303)
- Minor: Added ability to negate search options by prefixing it with an exclamation mark (e.g. `!badge:mod` to search for messages where the author does not have the moderator badge). (#4207) - Minor: Added ability to negate search options by prefixing it with an exclamation mark (e.g. `!badge:mod` to search for messages where the author does not have the moderator badge). (#4207)

View file

@ -148,11 +148,14 @@ else()
add_subdirectory("${CMAKE_SOURCE_DIR}/lib/settings" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/lib/settings" EXCLUDE_FROM_ALL)
endif() endif()
add_custom_target(
Lua ALL set(LUA_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/lib/lua/src")
COMMAND make add_subdirectory(lib/lua)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/lua #add_custom_target(
) # Lua ALL
# COMMAND make
# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/lua
#)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)

55
lib/lua/CMakeLists.txt Normal file
View file

@ -0,0 +1,55 @@
project(lua CXX)
set(LUA_VERSION_MAJOR 5)
set(LUA_VERSION_MINOR 4)
set(LUA_VERSION_PATCH 4)
set(LUA_VERSION "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
#[====[
Updating this list:
remove all listed files
go to line below, ^y2j4j$@" and then reindent the file names
/LUA_SRC
:r!ls lib/lua/src | grep '\.c' | grep -Ev 'lua\.c|onelua\.c' | sed 's#^#src/#'
#]====]
set(LUA_SRC
"src/lapi.c"
"src/lauxlib.c"
"src/lbaselib.c"
"src/lcode.c"
"src/lcorolib.c"
"src/lctype.c"
"src/ldblib.c"
"src/ldebug.c"
"src/ldo.c"
"src/ldump.c"
"src/lfunc.c"
"src/lgc.c"
"src/linit.c"
"src/liolib.c"
"src/llex.c"
"src/lmathlib.c"
"src/lmem.c"
"src/loadlib.c"
"src/lobject.c"
"src/lopcodes.c"
"src/loslib.c"
"src/lparser.c"
"src/lstate.c"
"src/lstring.c"
"src/lstrlib.c"
"src/ltable.c"
"src/ltablib.c"
"src/ltests.c"
"src/ltm.c"
"src/lua.c"
"src/lundump.c"
"src/lutf8lib.c"
"src/lvm.c"
"src/lzio.c"
)
add_library(lua STATIC ${LUA_SRC})
#target_link_libraries(lua ${LIBS})
set_source_files_properties(${LUA_SRC} PROPERTIES LANGUAGE CXX)

View file

@ -600,10 +600,11 @@ if (CHATTERINO_GENERATE_COVERAGE)
) )
endif () endif ()
add_dependencies(${LIBRARY_PROJECT} Lua)
target_include_directories(${LIBRARY_PROJECT} #add_dependencies(${LIBRARY_PROJECT} Lua)
PUBLIC "${CMAKE_SOURCE_DIR}/lib/lua/" #target_include_directories(${LIBRARY_PROJECT}
) # PUBLIC "${CMAKE_SOURCE_DIR}/lib/lua/"
# )
target_link_libraries(${LIBRARY_PROJECT} target_link_libraries(${LIBRARY_PROJECT}
PUBLIC PUBLIC
Qt${MAJOR_QT_VERSION}::Core Qt${MAJOR_QT_VERSION}::Core
@ -622,7 +623,7 @@ target_link_libraries(${LIBRARY_PROJECT}
RapidJSON::RapidJSON RapidJSON::RapidJSON
LRUCache LRUCache
MagicEnum MagicEnum
"${CMAKE_SOURCE_DIR}/lib/lua/liblua.a" lua
) )
if (BUILD_WITH_QTKEYCHAIN) if (BUILD_WITH_QTKEYCHAIN)

View file

@ -45,16 +45,13 @@
#include "widgets/splits/SplitContainer.hpp" #include "widgets/splits/SplitContainer.hpp"
#include "widgets/Window.hpp" #include "widgets/Window.hpp"
#include <lua.h>
#include <QApplication> #include <QApplication>
#include <QDesktopServices> #include <QDesktopServices>
#include <QFile> #include <QFile>
#include <QRegularExpression> #include <QRegularExpression>
#include <QUrl> #include <QUrl>
extern "C" {
#include <lua.h>
}
namespace { namespace {
using namespace chatterino; using namespace chatterino;

View file

@ -12,12 +12,11 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
extern "C" { //extern "C" {
#include <lauxlib.h> #include "lauxlib.h"
#include <lua.h> #include "lua.h"
#include <lualib.h> #include "lualib.h"
#include <qfileinfo.h> //}
}
namespace chatterino { namespace chatterino {