More work on making intellisense work
This commit is contained in:
@@ -41,10 +41,11 @@
|
|||||||
"C_Cpp.intelliSenseEngine": "disabled",
|
"C_Cpp.intelliSenseEngine": "disabled",
|
||||||
"clangd.path": "/usr/bin/clangd-15",
|
"clangd.path": "/usr/bin/clangd-15",
|
||||||
"clangd.arguments": [
|
"clangd.arguments": [
|
||||||
|
"--query-driver=/usr/bin/g++",
|
||||||
"--compile-commands-dir=[INTEGRATION]/.vscode",
|
"--compile-commands-dir=[INTEGRATION]/.vscode",
|
||||||
"--header-insertion=never"
|
"--header-insertion=never"
|
||||||
],
|
],
|
||||||
"C_Cpp.autocomplete": "Disabled"
|
"C_Cpp.autocomplete": "disabled"
|
||||||
},
|
},
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
|
|||||||
10
build.py
10
build.py
@@ -263,10 +263,14 @@ def build_intellisense_database_for_clangd(force):
|
|||||||
create_tarfile(f"{INTEGRATION}/Intermediate", "*.rsp", f"{INTEGRATION}/rsp_files.tgz")
|
create_tarfile(f"{INTEGRATION}/Intermediate", "*.rsp", f"{INTEGRATION}/rsp_files.tgz")
|
||||||
create_tarfile(f"{UNREALENGINE}/Engine", "*.rsp", f"{UNREALENGINE}/rsp_files.tgz")
|
create_tarfile(f"{UNREALENGINE}/Engine", "*.rsp", f"{UNREALENGINE}/rsp_files.tgz")
|
||||||
try:
|
try:
|
||||||
shell(INTEGRATION, f"{UNREALENGINE}/Engine/Build/BatchFiles/{BUILD_BAT} -waitmutex IntegrationEditor {OS} DebugGame {INTEGRATION}/Integration.uproject -mode=GenerateClangDatabase -OutputDir={UNREALENGINE}/.vscode")
|
Path(f"{INTEGRATION}/.vscode/compile_commands.json").unlink(missing_ok=True)
|
||||||
|
shell(INTEGRATION, f"{UNREALENGINE}/Engine/Build/BatchFiles/{BUILD_BAT} -waitmutex IntegrationEditor {OS} DebugGame {INTEGRATION}/Integration.uproject -mode=GenerateClangDatabase -OutputDir={INTEGRATION}/.vscode")
|
||||||
shell(UNREALENGINE, f"{UNREALENGINE}/Engine/Build/BatchFiles/{BUILD_BAT} -waitmutex UnrealEditor {OS} DebugGame -mode=GenerateClangDatabase -OutputDir={UNREALENGINE}/.vscode")
|
shell(UNREALENGINE, f"{UNREALENGINE}/Engine/Build/BatchFiles/{BUILD_BAT} -waitmutex UnrealEditor {OS} DebugGame -mode=GenerateClangDatabase -OutputDir={UNREALENGINE}/.vscode")
|
||||||
shell(INTEGRATION, f"cat {UNREALENGINE}/.vscode/compile_commands.json >> {INTEGRATION}/.vscode/compile_commands.json")
|
cc1 = json.loads(Path(f"{INTEGRATION}/.vscode/compile_commands.json").read_text())
|
||||||
shell(INTEGRATION, f"cat {INTEGRATION}/luprex/build/{OS}/compile_commands.json >> {INTEGRATION}/.vscode/compile_commands.json")
|
cc2 = json.loads(Path(f"{INTEGRATION}/luprex/build/{OS}/compile_commands.json").read_text())
|
||||||
|
cc3 = json.loads(Path(f"{UNREALENGINE}/.vscode/compile_commands.json").read_text())
|
||||||
|
cc = cc1 + cc2 + cc3
|
||||||
|
Path(f"{INTEGRATION}/.vscode/compile_commands.json").write_text(json.dumps(cc, indent=2))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error = e
|
error = e
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ ifeq "$(OS)" "Linux"
|
|||||||
LINKEXE:=g++ -Wall $(OPT) -std=c++20 -export-dynamic -o
|
LINKEXE:=g++ -Wall $(OPT) -std=c++20 -export-dynamic -o
|
||||||
MAKEDEPS:=true
|
MAKEDEPS:=true
|
||||||
LIBS:=-L./ext/openssl-3.0.1/lib/linux -lssl -lcrypto -ldl
|
LIBS:=-L./ext/openssl-3.0.1/lib/linux -lssl -lcrypto -ldl
|
||||||
CCJSON="build/$(OS)/compile_commands.json"
|
CCJSON:=build/$(OS)/compile_commands.json
|
||||||
|
|
||||||
FLAGS_ERIS:=-DLUA_USE_APICHECK -DLUA_USE_POSIX
|
FLAGS_ERIS:=-DLUA_USE_APICHECK -DLUA_USE_POSIX
|
||||||
FLAGS_CORE:=-I./ext/eris-master/src -I./cpp/wrap -I./cpp/core -I./ext
|
FLAGS_CORE:=-I./ext/eris-master/src -I./cpp/wrap -I./cpp/core -I./ext
|
||||||
@@ -60,7 +60,7 @@ ifeq "$(OS)" "Windows"
|
|||||||
LINKEXE:=CL $(OPT) /std:c++20 /EHsc /nologo /Fe:
|
LINKEXE:=CL $(OPT) /std:c++20 /EHsc /nologo /Fe:
|
||||||
MAKEDEPS:=g++ -Wall -std=c++20 -MMD -E -o
|
MAKEDEPS:=g++ -Wall -std=c++20 -MMD -E -o
|
||||||
LIBS:=ext/openssl-3.1.0/lib/visual/libcrypto.lib ext/openssl-3.1.0/lib/visual/libssl.lib ws2_32.lib crypt32.lib cryptui.lib user32.lib advapi32.lib
|
LIBS:=ext/openssl-3.1.0/lib/visual/libcrypto.lib ext/openssl-3.1.0/lib/visual/libssl.lib ws2_32.lib crypt32.lib cryptui.lib user32.lib advapi32.lib
|
||||||
CCJSON="build/$(OS)/compile_commands.json"
|
CCJSON:=build/$(OS)/compile_commands.json
|
||||||
|
|
||||||
FLAGS_ERIS:=-DLUA_USE_APICHECK -DLUA_COMPAT_ALL
|
FLAGS_ERIS:=-DLUA_USE_APICHECK -DLUA_COMPAT_ALL
|
||||||
FLAGS_CORE:=-I./ext/eris-master/src -I./cpp/wrap -I./cpp/core -I./ext
|
FLAGS_CORE:=-I./ext/eris-master/src -I./cpp/wrap -I./cpp/core -I./ext
|
||||||
@@ -132,7 +132,7 @@ build/$(OS)/drv/%.obj: cpp/drv/%.cpp build/$(OS)/DIRECTORY
|
|||||||
$(COMPILE) $@ $(FLAGS_DRV) $<
|
$(COMPILE) $@ $(FLAGS_DRV) $<
|
||||||
|
|
||||||
$(CCJSON): Makefile add-compile-commands.py
|
$(CCJSON): Makefile add-compile-commands.py
|
||||||
rm -rf $(CCJSON)
|
echo "[]" > $(CCJSON)
|
||||||
python3 ./add-compile-commands.py "$(CCJSON)" "$(COMPILE)" "$(FLAGS_ERIS)" "build/$(OS)/eris/FILE.obj" "ext/eris-master/src/FILE.c" $(BASE_ERIS)
|
python3 ./add-compile-commands.py "$(CCJSON)" "$(COMPILE)" "$(FLAGS_ERIS)" "build/$(OS)/eris/FILE.obj" "ext/eris-master/src/FILE.c" $(BASE_ERIS)
|
||||||
python3 ./add-compile-commands.py "$(CCJSON)" "$(COMPILE)" "$(FLAGS_CORE)" "build/$(OS)/cpp/FILE.obj" "cpp/core/FILE.cpp" $(BASE_CORE)
|
python3 ./add-compile-commands.py "$(CCJSON)" "$(COMPILE)" "$(FLAGS_CORE)" "build/$(OS)/cpp/FILE.obj" "cpp/core/FILE.cpp" $(BASE_CORE)
|
||||||
python3 ./add-compile-commands.py "$(CCJSON)" "$(COMPILE)" "$(FLAGS_DRV)" "build/$(OS)/drv/FILE.obj" "cpp/drv/FILE.cpp" $(BASE_DRV)
|
python3 ./add-compile-commands.py "$(CCJSON)" "$(COMPILE)" "$(FLAGS_DRV)" "build/$(OS)/drv/FILE.obj" "cpp/drv/FILE.cpp" $(BASE_DRV)
|
||||||
|
|||||||
@@ -1,23 +1,27 @@
|
|||||||
|
|
||||||
|
|
||||||
import sys, os
|
import sys, os, json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
LUPREXDIR=os.path.dirname(os.path.abspath(sys.argv[0]))
|
LUPREXDIR=os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||||
|
|
||||||
JSON=sys.argv[1]
|
JSONFILE=sys.argv[1]
|
||||||
COMPILE=sys.argv[2]
|
COMPILE=sys.argv[2]
|
||||||
FLAGS=sys.argv[3]
|
FLAGS=sys.argv[3]
|
||||||
OBJPAT=sys.argv[4]
|
OBJPAT=sys.argv[4]
|
||||||
CPAT=sys.argv[5]
|
CPAT=sys.argv[5]
|
||||||
OBJECTS=sys.argv[6:]
|
OBJECTS=sys.argv[6:]
|
||||||
|
|
||||||
with open(JSON, "a") as cc:
|
|
||||||
for base in OBJECTS:
|
JSON = json.loads(Path(JSONFILE).read_text())
|
||||||
obj = LUPREXDIR + "/" + OBJPAT.replace("FILE", base)
|
|
||||||
file = LUPREXDIR + "/" + CPAT.replace("FILE", base)
|
for base in OBJECTS:
|
||||||
flags = FLAGS.replace("-I./", f"-I{LUPREXDIR}/")
|
obj = LUPREXDIR + "/" + OBJPAT.replace("FILE", base)
|
||||||
cc.write('{\n')
|
file = LUPREXDIR + "/" + CPAT.replace("FILE", base)
|
||||||
cc.write(f' "file" : "{file}",\n')
|
flags = FLAGS.replace("-I./", f"-I{LUPREXDIR}/")
|
||||||
cc.write(f' "command" : "{COMPILE} {obj} {flags} {file}",\n')
|
command = f"{COMPILE} {obj} {flags} {file}"
|
||||||
cc.write(f' "directory" : "{LUPREXDIR}"\n')
|
JSON.append({"file": file, "command": command, "directory": LUPREXDIR })
|
||||||
cc.write('}\n')
|
|
||||||
|
Path(JSONFILE).write_text(json.dumps(JSON, indent=4))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ enum DrvAction {
|
|||||||
PLAY_RELEASE,
|
PLAY_RELEASE,
|
||||||
};
|
};
|
||||||
|
|
||||||
inline static const char *action_string(DrvAction act) {
|
[[maybe_unused]] inline static const char *action_string(DrvAction act) {
|
||||||
switch(act) {
|
switch(act) {
|
||||||
case PLAY_INITIALIZE: return "PLAY_INITIALIZE";
|
case PLAY_INITIALIZE: return "PLAY_INITIALIZE";
|
||||||
case PLAY_CLEAR_NEW_OUTGOING: return "PLAY_CLEAR_NEW_OUTGOING";
|
case PLAY_CLEAR_NEW_OUTGOING: return "PLAY_CLEAR_NEW_OUTGOING";
|
||||||
@@ -233,6 +233,7 @@ inline static const char *action_string(DrvAction act) {
|
|||||||
default: return "unknown";
|
default: return "unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ namespace eng {
|
|||||||
void *operator new(size_t size)
|
void *operator new(size_t size)
|
||||||
{
|
{
|
||||||
assert(false && "not supposed to 'new' this class");
|
assert(false && "not supposed to 'new' this class");
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *p, size_t size)
|
void operator delete(void *p, size_t size)
|
||||||
@@ -180,7 +179,6 @@ namespace eng {
|
|||||||
void *operator new[](size_t size)
|
void *operator new[](size_t size)
|
||||||
{
|
{
|
||||||
assert(false && "not supposed to 'new' this class");
|
assert(false && "not supposed to 'new' this class");
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete[](void *p, size_t size)
|
void operator delete[](void *p, size_t size)
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
#ifndef ENGINEWRAPPER_H
|
#ifndef ENGINEWRAPPER_H
|
||||||
#define ENGINEWRAPPER_H
|
#define ENGINEWRAPPER_H
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
#define DRV_MAX_CHAN 256
|
#define DRV_MAX_CHAN 256
|
||||||
#define DRV_MAX_LISTEN_PORTS 256
|
#define DRV_MAX_LISTEN_PORTS 256
|
||||||
#define DRV_ERRMSG_SIZE 8192
|
#define DRV_ERRMSG_SIZE 8192
|
||||||
|
|||||||
@@ -687,7 +687,7 @@ HttpServerResponse World::http_serve(const HttpParser &request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the name of the desired function.
|
// Get the name of the desired function.
|
||||||
std::string_view orig_fn = request.first_path_component("index");
|
eng::string orig_fn = request.first_path_component("index");
|
||||||
eng::string lua_fn = HttpParser::to_lua_identifier(orig_fn);
|
eng::string lua_fn = HttpParser::to_lua_identifier(orig_fn);
|
||||||
if (lua_fn.empty()) {
|
if (lua_fn.empty()) {
|
||||||
response.fail(404, util::ss("cannot convert to lua function name: ", orig_fn));
|
response.fail(404, util::ss("cannot convert to lua function name: ", orig_fn));
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
namespace eng {
|
namespace eng {
|
||||||
template<class C, class T=std::char_traits<C>>
|
template<class C, class T=std::char_traits<C>>
|
||||||
class basic_ostringstream : public std::basic_ostringstream<C, T, eng::allocator<C>>, public eng::opnew {
|
class basic_ostringstream : public std::basic_ostringstream<C, T, eng::allocator<C>>, public eng::opnew {
|
||||||
using underlying = std::basic_ostringstream<C, T, eng::allocator<C>>;
|
using std::basic_ostringstream<C, T, eng::allocator<C>>::basic_ostringstream;
|
||||||
using underlying::basic_ostringstream;
|
|
||||||
};
|
};
|
||||||
//template<class C, class T=std::char_traits<C>>
|
//template<class C, class T=std::char_traits<C>>
|
||||||
//using basic_stringbuf = std::basic_stringbuf<C, T, eng::allocator<C>>;
|
//using basic_stringbuf = std::basic_stringbuf<C, T, eng::allocator<C>>;
|
||||||
|
|||||||
Reference in New Issue
Block a user