Skip to content

Commit

Permalink
Merge pull request Kode#1444 from tong/expose-shader-files
Browse files Browse the repository at this point in the history
Expose shader files in macro context
  • Loading branch information
RobDangerous authored Dec 17, 2022
2 parents 96354a9 + cdfea6a commit 5de75be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/kha/internal/ShadersBuilder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import haxe.Json;
import haxe.macro.Context;
import haxe.macro.Expr.Field;
import haxe.Serializer;
#if macro
import sys.io.File;
#end

using StringTools;

class ShadersBuilder {

#if macro
public static var files : Array<Dynamic>;
#end

macro static public function build(): Array<Field> {
var fields = Context.getBuildFields();

Expand All @@ -18,7 +25,7 @@ class ShadersBuilder {
// rebuild Shaders module whenever manifest file is changed
Context.registerModuleDependency(Context.getLocalModule(), manifestPath);

var files: Iterable<Dynamic> = content.files;
files = content.files;

var init = macro {};

Expand Down

0 comments on commit 5de75be

Please sign in to comment.