Skip to content

Commit

Permalink
Expose shader files in macro context
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed Dec 17, 2022
1 parent 96354a9 commit cdfea6a
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 cdfea6a

Please sign in to comment.