Skip to content

Commit

Permalink
Re-format the kfile and use an absolute path for the wayland-addFile
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Mar 15, 2022
1 parent 905c592 commit 02ad865
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions kfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ else if (platform === Platform.Android) {
addBackend('Graphics5/Vulkan');
project.addDefine('KORE_VULKAN');
project.addDefine('VK_USE_PLATFORM_ANDROID_KHR');
project.addLib("vulkan");
project.addLib('vulkan');
project.addDefine('KORE_ANDROID_API=24');
}
else if (graphics === GraphicsApi.OpenGL || graphics === GraphicsApi.Default) {
Expand Down Expand Up @@ -336,40 +336,40 @@ else if (platform === Platform.Linux || platform === Platform.FreeBSD) {
fs.mkdirSync(waylandDir);
}

const child_process = require("child_process");
const child_process = require('child_process');

function wl_protocol(protocol, file) {
const backend_path = path.resolve(waylandDir);
const protocol_path = path.resolve("/usr/share/wayland-protocols", protocol);
if (child_process.spawnSync("wayland-scanner", ["private-code", protocol_path, path.resolve(backend_path, file + ".c")]).status != 0) {
console.warn("Failed to generate wayland protocol files for", protocol);
const protocol_path = path.resolve('/usr/share/wayland-protocols', protocol);
if (child_process.spawnSync('wayland-scanner', ['private-code', protocol_path, path.resolve(backend_path, file + '.c')]).status !== 0) {
log.error('Failed to generate wayland protocol files for' + protocol);
}
if (child_process.spawnSync("wayland-scanner", ["client-header", protocol_path, path.resolve(backend_path, file + ".h")]).status != 0) {
console.warn("Failed to generate wayland protocol header for", protocol);
if (child_process.spawnSync('wayland-scanner', ['client-header', protocol_path, path.resolve(backend_path, file + '.h')]).status !== 0) {
log.error('Failed to generate wayland protocol header for' + protocol);
}
}

if (child_process.spawnSync("wayland-scanner", ["private-code", "/usr/share/wayland/wayland.xml", path.resolve(waylandDir, "wayland-protocol.c")]).status != 0) {
console.warn("Failed to generate wayland protocol files for", "/usr/share/wayland/wayland.xml");
if (child_process.spawnSync('wayland-scanner', ['private-code', '/usr/share/wayland/wayland.xml', path.resolve(waylandDir, 'wayland-protocol.c')]).status !== 0) {
log.error('Failed to generate wayland protocol files for /usr/share/wayland/wayland.xml');
}
if (child_process.spawnSync("wayland-scanner", ["client-header", "/usr/share/wayland/wayland.xml", path.resolve(waylandDir, "wayland-protocol.h")]).status != 0) {
console.warn("Failed to generate wayland protocol header for", "/usr/share/wayland/wayland.xml");
if (child_process.spawnSync('wayland-scanner', ['client-header', '/usr/share/wayland/wayland.xml', path.resolve(waylandDir, 'wayland-protocol.h')]).status !== 0) {
log.error('Failed to generate wayland protocol header for /usr/share/wayland/wayland.xml');
}
wl_protocol("stable/viewporter/viewporter.xml", "wayland-viewporter");
wl_protocol("stable/xdg-shell/xdg-shell.xml", "xdg-shell");
wl_protocol("unstable/xdg-decoration/xdg-decoration-unstable-v1.xml", "xdg-decoration");
wl_protocol("unstable/tablet/tablet-unstable-v2.xml", "wayland-tablet");
wl_protocol("unstable/pointer-constraints/pointer-constraints-unstable-v1.xml", "wayland-pointer-constraint");
wl_protocol("unstable/relative-pointer/relative-pointer-unstable-v1.xml", "wayland-relative-pointer");
wl_protocol('stable/viewporter/viewporter.xml', 'wayland-viewporter');
wl_protocol('stable/xdg-shell/xdg-shell.xml', 'xdg-shell');
wl_protocol('unstable/xdg-decoration/xdg-decoration-unstable-v1.xml', 'xdg-decoration');
wl_protocol('unstable/tablet/tablet-unstable-v2.xml', 'wayland-tablet');
wl_protocol('unstable/pointer-constraints/pointer-constraints-unstable-v1.xml', 'wayland-pointer-constraint');
wl_protocol('unstable/relative-pointer/relative-pointer-unstable-v1.xml', 'wayland-relative-pointer');

project.addIncludeDir(path.join(targetDirectory, 'wayland'));
project.addFile(waylandDir + "/**");
project.addFile(path.resolve(waylandDir, '**'));
}
else if (platform === Platform.FreeBSD) {
addBackend('System/FreeBSD');
project.addExclude('Backends/System/Linux/Sources/kinc/backend/input/gamepad.cpp');
project.addExclude('Backends/System/Linux/Sources/kinc/backend/input/gamepad.h');
project.addDefine("KINC_NO_WAYLAND");
project.addDefine('KINC_NO_WAYLAND');
}

if (graphics === GraphicsApi.Vulkan) {
Expand All @@ -385,8 +385,8 @@ else if (platform === Platform.Linux || platform === Platform.FreeBSD) {
project.addExclude('Backends/Graphics4/OpenGL/Sources/GL/glew.c');
project.addLib('GL');
project.addDefine('KORE_OPENGL');
project.addLib("EGL");
project.addDefine("KINC_EGL");
project.addLib('EGL');
project.addDefine('KINC_EGL');
}
else {
throw new Error('Graphics API ' + graphics + ' is not available for Linux.');
Expand Down

0 comments on commit 02ad865

Please sign in to comment.