forked from LeenkxTeam/Kmake
Update
This commit is contained in:
@ -33,14 +33,39 @@ export class MakeExporter extends Exporter {
|
||||
}
|
||||
|
||||
async exportSolution(project: Project, from: string, to: string, platform: string, vrApi: any, options: any) {
|
||||
let mFiles = [
|
||||
path.join(from, 'Kinc/Backends/System/Apple/Sources/kinc/backend/appleunit.m'),
|
||||
path.join(from, 'Kinc/Backends/System/macOS/Sources/kinc/backend/macosunit.m'),
|
||||
path.join(from, 'Kinc/Backends/System/macOS/Sources/kinc/backend/system.m.h'),
|
||||
path.join(from, 'Kinc/Backends/System/macOS/Sources/kinc/backend/BasicOpenGLView.m.h'),
|
||||
path.join(from, 'Kinc/Backends/System/macOS/Sources/kinc/backend/display.m.h'),
|
||||
path.join(from, 'Kinc/Backends/System/macOS/Sources/kinc/backend/mouse.m.h')
|
||||
];
|
||||
// TODO: Figure out why we cant get the relative path and if we even need to manually include the m files
|
||||
let koreBasePath = '';
|
||||
for (let fileobject of project.getFiles()) {
|
||||
if (fileobject.file.includes('Kore/Backends')) {
|
||||
let parts = fileobject.file.split('/');
|
||||
let koreIndex = parts.indexOf('Kore');
|
||||
if (koreIndex !== -1) {
|
||||
koreBasePath = parts.slice(0, koreIndex + 1).join('/');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
let mFiles = [
|
||||
koreBasePath + '/Backends/System/Apple/Sources/kinc/backend/appleunit.m',
|
||||
koreBasePath + '/Backends/System/macOS/Sources/kinc/backend/macosunit.m',
|
||||
koreBasePath + '/Backends/System/macOS/Sources/kinc/backend/system.m.h',
|
||||
koreBasePath + '/Backends/System/macOS/Sources/kinc/backend/BasicOpenGLView.m.h',
|
||||
koreBasePath + '/Backends/System/macOS/Sources/kinc/backend/display.m.h',
|
||||
koreBasePath + '/Backends/System/macOS/Sources/kinc/backend/mouse.m.h'
|
||||
];
|
||||
for (let mFile of mFiles) {
|
||||
let found = false;
|
||||
for (let fileobject of project.getFiles()) {
|
||||
if (fileobject.file === mFile) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
project.files.push({file: mFile, options: null, projectDir: from, projectName: project.name});
|
||||
}
|
||||
}
|
||||
|
||||
for (let mFile of mFiles) {
|
||||
let found = false;
|
||||
for (let fileobject of project.getFiles()) {
|
||||
|
||||
@ -631,19 +631,7 @@ async function exportKoremakeProject(from: string, to: string, platform: string,
|
||||
exporter = new MesonExporter(options);
|
||||
}
|
||||
else if (platform === Platform.OSX) {
|
||||
// Use MakeExporter directly for macOS to ensure .m files are compiled
|
||||
let linkerFlags = '-pthread';
|
||||
if (options.lib) {
|
||||
linkerFlags += ' -static';
|
||||
}
|
||||
let outputExtension = '';
|
||||
if (options.lib) {
|
||||
outputExtension = '.a';
|
||||
}
|
||||
else if (options.dynlib) {
|
||||
outputExtension = '.dylib';
|
||||
}
|
||||
exporter = new MakeExporter(options, 'clang', 'clang++', '', '', linkerFlags, outputExtension);
|
||||
exporter = new MacOSExporter(options);
|
||||
}
|
||||
else if (platform === Platform.iOS || platform === Platform.tvOS) exporter = new XCodeExporter(options);
|
||||
else if (platform === Platform.Android) exporter = new AndroidExporter(options);
|
||||
|
||||
Reference in New Issue
Block a user