Skip to content

Commit

Permalink
Support nocompile for Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Jan 31, 2025
1 parent 3e772da commit 8140e27
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
24 changes: 24 additions & 0 deletions kmake/src/Exporters/XCodeExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,18 @@ export class XCodeExporter extends Exporter {
if (platform === Platform.OSX && (!options.lib && !options.dynlib)) {
this.p('COMBINE_HIDPI_IMAGES = YES;', 4);
}

this.p('"EXCLUDED_SOURCE_FILE_NAMES[arch=*]" = (', 4);
for (let fileobject of project.getFiles()) {
let file = fileobject.file;
if (file.endsWith('.cpp') || file.endsWith('.c') || file.endsWith('.cc') || file.endsWith('.cxx') || file.endsWith('.m') || file.endsWith('.mm')) {
if (fileobject.options && fileobject.options.nocompile) {
this.p('"' + file + '",', 5);
}
}
}
this.p(');', 4);

this.p('FRAMEWORK_SEARCH_PATHS = (', 4);
this.p('"$(inherited)",', 5);
// Search paths to local frameworks
Expand Down Expand Up @@ -906,6 +918,18 @@ export class XCodeExporter extends Exporter {
if (platform === Platform.OSX && (!options.lib && !options.dynlib)) {
this.p('COMBINE_HIDPI_IMAGES = YES;', 4);
}

this.p('"EXCLUDED_SOURCE_FILE_NAMES[arch=*]" = (', 4);
for (let fileobject of project.getFiles()) {
let file = fileobject.file;
if (file.endsWith('.cpp') || file.endsWith('.c') || file.endsWith('.cc') || file.endsWith('.cxx') || file.endsWith('.m') || file.endsWith('.mm')) {
if (fileobject.options && fileobject.options.nocompile) {
this.p('"' + file + '",', 5);
}
}
}
this.p(');', 4);

this.p('FRAMEWORK_SEARCH_PATHS = (', 4);
this.p('"$(inherited)",', 5);
// Search paths to local frameworks
Expand Down
20 changes: 20 additions & 0 deletions lib/kmake/Exporters/XCodeExporter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/kmake/Exporters/XCodeExporter.js.map

Large diffs are not rendered by default.

0 comments on commit 8140e27

Please sign in to comment.