Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update target config after init macros #11985

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/compiler/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ let do_type ctx mctx actx display_file_dot_path =
Some (MacroContext.call_init_macro ctx.com mctx path)
) mctx (List.rev actx.config_macros) in
enter_stage com CInitMacrosDone;
update_platform_config com; (* make sure to adapt all flags changes defined during init macros *)
ServerMessage.compiler_stage com;

let macros = match mctx with None -> None | Some mctx -> mctx.g.macros in
Expand Down
1 change: 1 addition & 0 deletions tests/misc/js/projects/Issue11985/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.js
3 changes: 3 additions & 0 deletions tests/misc/js/projects/Issue11985/Macro.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function init() {
haxe.macro.Compiler.define("js-unflatten", "1");
}
4 changes: 4 additions & 0 deletions tests/misc/js/projects/Issue11985/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function main() {
haxe.Log.trace("hello");
var haxe = "haxe";
}
4 changes: 4 additions & 0 deletions tests/misc/js/projects/Issue11985/compile.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-main Main
--macro Macro.init()
-js test.js
-cmd "node test.js"
Loading