forked from LeenkxTeam/LNXRNT
Webview
This commit is contained in:
31
kfile.js
31
kfile.js
@ -10,6 +10,7 @@ let flags = {
|
||||
with_compute: true,
|
||||
with_networking: true,
|
||||
with_viewport: true,
|
||||
with_webview: true,
|
||||
with_uws: false,
|
||||
with_ssl: true,
|
||||
debug_network: true
|
||||
@ -62,6 +63,21 @@ if (flags.with_viewport && (platform === Platform.Windows || platform === Platfo
|
||||
project.addDefine('WITH_VIEWPORT');
|
||||
}
|
||||
|
||||
if (flags.with_webview && (platform === Platform.Windows || platform === Platform.Linux || platform === Platform.OSX)) {
|
||||
project.addDefine('WITH_WEBVIEW');
|
||||
project.addFile('Sources/webview.h');
|
||||
project.addFile('Sources/webview.cpp');
|
||||
if (platform === Platform.Windows) {
|
||||
project.addFile('Sources/webview_win.cpp');
|
||||
}
|
||||
else if (platform === Platform.OSX) {
|
||||
project.addFile('Sources/webview_mac.mm');
|
||||
}
|
||||
else if (platform === Platform.Linux) {
|
||||
project.addFile('Sources/webview_linux.cpp');
|
||||
}
|
||||
}
|
||||
|
||||
project.addFile('Sources/main.cpp');
|
||||
|
||||
|
||||
@ -124,6 +140,10 @@ if (platform === Platform.Windows) {
|
||||
project.addLib('Dwmapi'); // DWMWA_USE_IMMERSIVE_DARK_MODE
|
||||
project.addLib('winmm'); // timeGetTime for V8
|
||||
project.addLib(libdir + 'v8_monolith');
|
||||
if (flags.with_webview) {
|
||||
project.addIncludeDir('webview2/include');
|
||||
project.addLib('WebView2Loader.lib');
|
||||
}
|
||||
if (!flags.release) {
|
||||
project.addDefine('_HAS_ITERATOR_DEBUGGING=0');
|
||||
project.addDefine('_ITERATOR_DEBUG_LEVEL=0');
|
||||
@ -135,14 +155,25 @@ if (platform === Platform.Windows) {
|
||||
}
|
||||
}
|
||||
else if (platform === Platform.Linux) {
|
||||
project.addCppFlag('-fno-rtti');
|
||||
project.addLib('v8_monolith -L' + libdir);
|
||||
project.addDefine("KINC_NO_WAYLAND");
|
||||
if (flags.with_webview) {
|
||||
project.addLib('webkit2gtk-4.1');
|
||||
project.addLib('gtk-3');
|
||||
project.addLib('glib-2.0');
|
||||
}
|
||||
if (flags.with_networking) {
|
||||
project.addLib('pthread');
|
||||
}
|
||||
}
|
||||
else if (platform === Platform.OSX) {
|
||||
project.addCppFlag('-fno-rtti');
|
||||
project.addLib('v8_monolith -L' + libdir);
|
||||
if (flags.with_webview) {
|
||||
project.addLinkerFlag('-framework WebKit');
|
||||
project.addLinkerFlag('-framework AppKit');
|
||||
}
|
||||
if (flags.with_networking) {
|
||||
project.addIncludeDir('apple-libressl-sdk/include');
|
||||
project.addLinkerFlag('-L' + root + '/apple-libressl-sdk/lib');
|
||||
|
||||
Reference in New Issue
Block a user