mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2024-12-22 11:55:29 +01:00
improve LuaEngineApp build
This commit is contained in:
parent
eec5071578
commit
262533dae9
4 changed files with 24 additions and 16 deletions
|
@ -36,7 +36,7 @@ LuaEngineApp:
|
|||
script:
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- qmake-static CONFIG+=WITH_LUAENGINEAPP DEFINES+=LUAENGINE_FOOTER_SCRIPT ../luaengine.pro
|
||||
- qmake-static CONFIG+=WITH_LUAENGINEAPP ../luaengine.pro
|
||||
- make -j4
|
||||
- cp -Rf src/luaengineapp/release/LuaEngineApp.exe ../windows.le
|
||||
- cd ..
|
||||
|
|
|
@ -40,8 +40,8 @@ OTHER_FILES += \
|
|||
app.lua \
|
||||
app.rc
|
||||
|
||||
|
||||
!defined(LUAENGINE_FOOTER_SCRIPT) {
|
||||
win32: HEADERS += resource.h
|
||||
win32: RC_FILE = app.rc
|
||||
win32: CONFIG(LUAENGINE_RESOURCE_SCRIPT) {
|
||||
DEFINES += LUAENGINE_RESOURCE_SCRIPT
|
||||
HEADERS += resource.h
|
||||
RC_FILE = app.rc
|
||||
}
|
||||
|
|
|
@ -42,7 +42,17 @@ int main(int argc, char *argv[])
|
|||
|
||||
QByteArray luaScript;
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef LUAENGINE_FOOTER_SCRIPT
|
||||
#ifdef LUAENGINE_RESOURCE_SCRIPT
|
||||
{
|
||||
HMODULE handle = GetModuleHandleW(NULL);
|
||||
HRSRC resource = FindResourceW(handle, MAKEINTRESOURCE(IDR_SCRIPT1), L"SCRIPT");
|
||||
HGLOBAL resourceData = LoadResource(handle, resource);
|
||||
DWORD size = SizeofResource(handle, resource);
|
||||
const char *data = static_cast<const char*>(LockResource(resourceData));
|
||||
luaScript = QByteArray(data, size);
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
QFile executable(a.arguments().at(0));
|
||||
if (executable.open(QIODevice::ReadOnly)) {
|
||||
|
@ -62,16 +72,6 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
HMODULE handle = GetModuleHandleW(NULL);
|
||||
HRSRC resource = FindResourceW(handle, MAKEINTRESOURCE(IDR_SCRIPT1), L"SCRIPT");
|
||||
HGLOBAL resourceData = LoadResource(handle, resource);
|
||||
DWORD size = SizeofResource(handle, resource);
|
||||
const char *data = static_cast<const char*>(LockResource(resourceData));
|
||||
luaScript = QByteArray(data, size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -32,3 +32,11 @@ INCLUDEPATH += \
|
|||
|
||||
SOURCES += \
|
||||
main.cpp
|
||||
|
||||
win32 {
|
||||
RC_LANG = 0x0
|
||||
QMAKE_TARGET_COMPANY = "Syping"
|
||||
QMAKE_TARGET_DESCRIPTION = "LuaEngine Compiler"
|
||||
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2019 Syping"
|
||||
QMAKE_TARGET_PRODUCT = "luaenginec"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue