From aff3b065a4f09670f4dd3e35419bdcd5c620f70c Mon Sep 17 00:00:00 2001 From: Chris Speciale <26172437+dimensionscape@users.noreply.github.com> Date: Mon, 12 Oct 2026 05:56:14 -0400 Subject: [PATCH 1/3] Compare upper-case defines when deciding what Options.txt changed filterOptions keeps the defines that affect compilation, but matched names case-sensitively against lower-case patterns. Haxe writes defines as they were given, so -D HXCPP_M64, HXCPP_TELEMETRY or HXCPP_GC_BIG_BLOCKS never reached the comparison: toggling one recompiled only the files whose generated source happened to change and none of the runtime, leaving objects built both ways. A program built plainly and then with -D HXCPP_TELEMETRY recompiled one file and failed to link on hx::StackContext::getStackForId. It now recompiles every source, links and runs. Defines whose spellings already matched are unaffected. A project that passes upper-case HXCPP_ defines recompiles once after updating, since the stored options now include them. --- tools/hxcpp/FileGroup.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/hxcpp/FileGroup.hx b/tools/hxcpp/FileGroup.hx index 355e41588..2d7ee7bba 100644 --- a/tools/hxcpp/FileGroup.hx +++ b/tools/hxcpp/FileGroup.hx @@ -204,7 +204,8 @@ class FileGroup var result = new Array(); for(def in contents.split("\n")) { - var name = def.split("=")[0];//.toLowerCase(); + // Haxe writes defines as they were given, so -D HXCPP_M64 arrives upper case + var name = def.split("=")[0].toLowerCase(); if (name.indexOf("hxcpp_link")>=0) { // Only effects linking, not compiling From 879128e5cb2b04eda859cc7e1bebf75e0fd623e7 Mon Sep 17 00:00:00 2001 From: Chris Speciale <26172437+dimensionscape@users.noreply.github.com> Date: Mon, 12 Oct 2026 06:04:57 -0400 Subject: [PATCH 2/3] Track Options.txt in the library groups that compile hxcpp code hxcpp_std, hxcpp_regexp, hxcpp_ssl, hxcpp_sqlite, hxcpp_mysql, hxcpp_zip_api and hxcpp_zlib_impl compile against hxcpp's headers, whose inline allocator depends on defines such as HXCPP_TELEMETRY, HXCPP_GC_BIG_BLOCKS and HXCPP_M64, but only the haxe, runtime and main groups listed Options.txt. Toggling HXCPP_TELEMETRY left these libraries as they were last compiled. After they were rebuilt under telemetry, turning it off failed to link: Sys, File, Socket, SSL, RegExp and the zlib wrappers still called __hxt_gc_new and __hxt_gc_alloc. ifExists keeps a standalone build of a library, which has no Options.txt, working as before. --- src/hx/libs/mysql/Build.xml | 1 + src/hx/libs/regexp/Build.xml | 1 + src/hx/libs/sqlite/Build.xml | 1 + src/hx/libs/ssl/Build.xml | 1 + src/hx/libs/std/Build.xml | 1 + src/hx/zip/Build.xml | 1 + src/hx/zip/zlib/Build.xml | 1 + 7 files changed, 7 insertions(+) diff --git a/src/hx/libs/mysql/Build.xml b/src/hx/libs/mysql/Build.xml index 76e497850..722c234c5 100644 --- a/src/hx/libs/mysql/Build.xml +++ b/src/hx/libs/mysql/Build.xml @@ -1,6 +1,7 @@ + diff --git a/src/hx/libs/regexp/Build.xml b/src/hx/libs/regexp/Build.xml index 46a1fba14..fdfedeaae 100644 --- a/src/hx/libs/regexp/Build.xml +++ b/src/hx/libs/regexp/Build.xml @@ -27,6 +27,7 @@ + diff --git a/src/hx/libs/sqlite/Build.xml b/src/hx/libs/sqlite/Build.xml index b17ca5420..3b1596591 100644 --- a/src/hx/libs/sqlite/Build.xml +++ b/src/hx/libs/sqlite/Build.xml @@ -5,6 +5,7 @@ + diff --git a/src/hx/libs/ssl/Build.xml b/src/hx/libs/ssl/Build.xml index 2240f564a..98ad8d3e8 100644 --- a/src/hx/libs/ssl/Build.xml +++ b/src/hx/libs/ssl/Build.xml @@ -5,6 +5,7 @@ + diff --git a/src/hx/libs/std/Build.xml b/src/hx/libs/std/Build.xml index f18ee01bb..3a790aea9 100644 --- a/src/hx/libs/std/Build.xml +++ b/src/hx/libs/std/Build.xml @@ -3,6 +3,7 @@ + diff --git a/src/hx/zip/Build.xml b/src/hx/zip/Build.xml index 0cf31265b..cb9012da8 100644 --- a/src/hx/zip/Build.xml +++ b/src/hx/zip/Build.xml @@ -8,6 +8,7 @@ + diff --git a/src/hx/zip/zlib/Build.xml b/src/hx/zip/zlib/Build.xml index 6289ab59f..6439b9590 100644 --- a/src/hx/zip/zlib/Build.xml +++ b/src/hx/zip/zlib/Build.xml @@ -31,6 +31,7 @@ + From fa22b9b5f082267475b00a3e0c4c6995f5320764 Mon Sep 17 00:00:00 2001 From: Chris Speciale <26172437+dimensionscape@users.noreply.github.com> Date: Mon, 12 Oct 2026 06:08:56 -0400 Subject: [PATCH 3/3] Resolve an options file against the directory the build was started in A group from an imported Build.xml is built from its own directory, so the relative Options.txt that hxcpp_zlib_impl now lists was found by ifExists when the XML was read but not when the group was checked: "Could not find dependencies for hxcpp_zlib_impl : [ Options.txt ]". The path is now made absolute when it is read. Every group that listed an options file before is built from the start directory, where the path resolves to the same file. --- tools/hxcpp/BuildTool.hx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/hxcpp/BuildTool.hx b/tools/hxcpp/BuildTool.hx index cd5a48f5b..fcea8c4ab 100644 --- a/tools/hxcpp/BuildTool.hx +++ b/tools/hxcpp/BuildTool.hx @@ -1123,7 +1123,13 @@ class BuildTool case "hlsl" : group.addHLSL( substitute(el.att.name), substitute(el.att.profile), substitute(el.att.variable), substitute(el.att.target) ); - case "options" : group.addOptions( substitute(el.att.name) ); + case "options" : + // Resolved now, where ifExists is checked: an imported group is built from its own + // directory, where a relative Options.txt would not be found. + var options = substitute(el.att.name); + if (!PathManager.isAbsolute(options)) + options = PathManager.combine(Sys.getCwd(), options); + group.addOptions(options); case "config" : group.mConfig = substitute(el.att.name); case "assembler" : group.mAssembler = substitute(el.att.name); case "compilerflag" :