Skip to content

Commit 8140e27

Browse files
committed
Support nocompile for Xcode
1 parent 3e772da commit 8140e27

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

kmake/src/Exporters/XCodeExporter.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,18 @@ export class XCodeExporter extends Exporter {
811811
if (platform === Platform.OSX && (!options.lib && !options.dynlib)) {
812812
this.p('COMBINE_HIDPI_IMAGES = YES;', 4);
813813
}
814+
815+
this.p('"EXCLUDED_SOURCE_FILE_NAMES[arch=*]" = (', 4);
816+
for (let fileobject of project.getFiles()) {
817+
let file = fileobject.file;
818+
if (file.endsWith('.cpp') || file.endsWith('.c') || file.endsWith('.cc') || file.endsWith('.cxx') || file.endsWith('.m') || file.endsWith('.mm')) {
819+
if (fileobject.options && fileobject.options.nocompile) {
820+
this.p('"' + file + '",', 5);
821+
}
822+
}
823+
}
824+
this.p(');', 4);
825+
814826
this.p('FRAMEWORK_SEARCH_PATHS = (', 4);
815827
this.p('"$(inherited)",', 5);
816828
// Search paths to local frameworks
@@ -906,6 +918,18 @@ export class XCodeExporter extends Exporter {
906918
if (platform === Platform.OSX && (!options.lib && !options.dynlib)) {
907919
this.p('COMBINE_HIDPI_IMAGES = YES;', 4);
908920
}
921+
922+
this.p('"EXCLUDED_SOURCE_FILE_NAMES[arch=*]" = (', 4);
923+
for (let fileobject of project.getFiles()) {
924+
let file = fileobject.file;
925+
if (file.endsWith('.cpp') || file.endsWith('.c') || file.endsWith('.cc') || file.endsWith('.cxx') || file.endsWith('.m') || file.endsWith('.mm')) {
926+
if (fileobject.options && fileobject.options.nocompile) {
927+
this.p('"' + file + '",', 5);
928+
}
929+
}
930+
}
931+
this.p(');', 4);
932+
909933
this.p('FRAMEWORK_SEARCH_PATHS = (', 4);
910934
this.p('"$(inherited)",', 5);
911935
// Search paths to local frameworks

lib/kmake/Exporters/XCodeExporter.js

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/kmake/Exporters/XCodeExporter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)