Skip to content

Commit

Permalink
Support Metal shaders in modules
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoole committed Jul 17, 2020
1 parent 6a01abb commit 31613e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion extras/Projucer/Source/Project/Modules/jucer_Modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ Array<LibraryModule::CompileUnit> LibraryModule::getAllCompileUnits (build_tools
for (auto& cu : units)
{
cu.isCompiledForObjC = true;
cu.isCompiledForNonObjC = ! cu.file.hasFileExtension ("mm;m");
cu.isCompiledForNonObjC = ! cu.file.hasFileExtension ("mm;m;metal");

if (cu.isCompiledForNonObjC)
if (cu.file.withFileExtension ("mm").existsAsFile())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,9 @@ class XcodeProjectExporter : public ProjectExporter
}

StringArray headerPaths (getHeaderSearchPaths (config));

s.set ("MTL_HEADER_SEARCH_PATHS", indentParenthesisedList (headerPaths, 1));

headerPaths.add ("\"$(inherited)\"");
s.set ("HEADER_SEARCH_PATHS", indentParenthesisedList (headerPaths, 1));
s.set ("USE_HEADERMAP", String (static_cast<bool> (config.exporter.settings.getProperty ("useHeaderMap")) ? "YES" : "NO"));
Expand Down
8 changes: 4 additions & 4 deletions extras/Projucer/Source/Utility/Helpers/jucer_FileHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ namespace FileHelpers
}

//==============================================================================
const char* const sourceFileExtensions = "cpp;mm;m;c;cc;cxx;swift;s;asm;r";
const char* const sourceFileExtensions = "cpp;mm;m;metal;c;cc;cxx;swift;s;asm;r";
const char* const headerFileExtensions = "h;hpp;hxx;hh;inl";
const char* const cOrCppFileExtensions = "cpp;cc;cxx;c";
const char* const cppFileExtensions = "cpp;cc;cxx";
const char* const objCFileExtensions = "mm;m";
const char* const asmFileExtensions = "s;S;asm";
const char* const sourceOrHeaderFileExtensions = "cpp;mm;m;c;cc;cxx;swift;s;S;asm;h;hpp;hxx;hh;inl";
const char* const browseableFileExtensions = "cpp;mm;m;c;cc;cxx;swift;s;S;asm;h;hpp;hxx;hh;inl;txt;md;rtf";
const char* const fileTypesToCompileByDefault = "cpp;mm;c;m;cc;cxx;swift;s;S;asm;r";
const char* const sourceOrHeaderFileExtensions = "cpp;mm;m;metal;c;cc;cxx;swift;s;S;asm;h;hpp;hxx;hh;inl";
const char* const browseableFileExtensions = "cpp;mm;m;metal;c;cc;cxx;swift;s;S;asm;h;hpp;hxx;hh;inl;txt;md;rtf";
const char* const fileTypesToCompileByDefault = "cpp;mm;m;metal;c;cc;cxx;swift;s;S;asm;r";

//==============================================================================
struct FileModificationDetector
Expand Down

0 comments on commit 31613e8

Please sign in to comment.