From 582af19464f9296f23897bb6cc23dd3bb555d719 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 22:32:04 +0000 Subject: [PATCH 1/4] [tools] Detect upper case HXCPP flag changes When a `HXCPP_ ...` flag changes, we should rebuild. In the past, these checks were case insensitive but that changed in: 72187839359e250636c8518457acfb05d0adb402 --- tools/hxcpp/FileGroup.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hxcpp/FileGroup.hx b/tools/hxcpp/FileGroup.hx index 355e41588..ffdf58eef 100644 --- a/tools/hxcpp/FileGroup.hx +++ b/tools/hxcpp/FileGroup.hx @@ -204,7 +204,7 @@ class FileGroup var result = new Array(); for(def in contents.split("\n")) { - var name = def.split("=")[0];//.toLowerCase(); + var name = def.split("=")[0]; if (name.indexOf("hxcpp_link")>=0) { // Only effects linking, not compiling @@ -213,7 +213,7 @@ class FileGroup { // Does not affect build } - else if (name.indexOf("hxcpp")>=0 || name=="scriptable" || name.indexOf("dll")>=0 || name=="no_console" || + else if (name.indexOf("hxcpp")>=0 || name.indexOf("HXCPP")>=0 || name=="scriptable" || name.indexOf("dll")>=0 || name=="no_console" || name.substr(0,8)=="android-" || name.substr(0,4)=="ndkv" || name=="toolchain" || name=="platform" || name=="toolchain_version" || name=="android_ndk_root" ) result.push(def); From 6ba4bf51f3f555430c70a37433bbe322ffe29a6a Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 23:13:44 +0000 Subject: [PATCH 2/4] [tools] Fix casing in options flag filtering Hxcpp only respects some of these in upper case, so make sure this filter matches what hxcpp uses. This also worked prior to: 72187839359e250636c8518457acfb05d0adb402 however, now it is more accurate and filters options only in the form that matches what Hxcpp will read. --- tools/hxcpp/FileGroup.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/hxcpp/FileGroup.hx b/tools/hxcpp/FileGroup.hx index ffdf58eef..44648b702 100644 --- a/tools/hxcpp/FileGroup.hx +++ b/tools/hxcpp/FileGroup.hx @@ -205,17 +205,17 @@ class FileGroup for(def in contents.split("\n")) { var name = def.split("=")[0]; - if (name.indexOf("hxcpp_link")>=0) + if (name.indexOf("HXCPP_LINK")>=0) { // Only effects linking, not compiling } - else if (name=="hxcpp_verbose" || name=="hxcpp_silent" || name=="hxcpp_quiet" || name=="hxcpp_times" || name=="hxcpp_neko_buildtool" || name=="hxcpp_link_no_tool_depends" ) + else if (name=="HXCPP_VERBOSE" || name=="HXCPP_SILENT" || name=="HXCPP_QUIET" || name=="HXCPP_TIMES" || name=="HXCPP_NEKO_BUILDTOOL" || name=="HXCPP_LINK_NO_TOOL_DEPENDS" ) { // Does not affect build } else if (name.indexOf("hxcpp")>=0 || name.indexOf("HXCPP")>=0 || name=="scriptable" || name.indexOf("dll")>=0 || name=="no_console" || - name.substr(0,8)=="android-" || name.substr(0,4)=="ndkv" || name=="toolchain" || name=="platform" || - name=="toolchain_version" || name=="android_ndk_root" ) + name.substr(0,8)=="android-" || name.substr(0,4)=="NDKV" || name=="toolchain" || name=="PLATFORM" || + name=="TOOLCHAIN_VERSION" || name=="ANDROID_NDK_ROOT" ) result.push(def); } From cc293bfdbb4a94a8978eb6061cdc2f19df28b9a7 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 23:25:24 +0000 Subject: [PATCH 3/4] [tests] Check rebuild with HXCPP_DEBUGGER Previously, rebuilding a project with HXCPP_DEBUGGER caused stale object files which gave linking errors. --- test/tools/rebuild-debugger/Main.hx | 1 + test/tools/rebuild-debugger/build-0-no-debugger.hxml | 2 ++ test/tools/rebuild-debugger/build-1-debugger.hxml | 3 +++ 3 files changed, 6 insertions(+) create mode 100644 test/tools/rebuild-debugger/Main.hx create mode 100644 test/tools/rebuild-debugger/build-0-no-debugger.hxml create mode 100644 test/tools/rebuild-debugger/build-1-debugger.hxml diff --git a/test/tools/rebuild-debugger/Main.hx b/test/tools/rebuild-debugger/Main.hx new file mode 100644 index 000000000..a71cf3b3e --- /dev/null +++ b/test/tools/rebuild-debugger/Main.hx @@ -0,0 +1 @@ +function main() {} diff --git a/test/tools/rebuild-debugger/build-0-no-debugger.hxml b/test/tools/rebuild-debugger/build-0-no-debugger.hxml new file mode 100644 index 000000000..b484e67e7 --- /dev/null +++ b/test/tools/rebuild-debugger/build-0-no-debugger.hxml @@ -0,0 +1,2 @@ +-m Main +--cpp bin diff --git a/test/tools/rebuild-debugger/build-1-debugger.hxml b/test/tools/rebuild-debugger/build-1-debugger.hxml new file mode 100644 index 000000000..364ae2e8b --- /dev/null +++ b/test/tools/rebuild-debugger/build-1-debugger.hxml @@ -0,0 +1,3 @@ +-m Main +--cpp bin +-D HXCPP_DEBUGGER From f134c95ef241ce8ce016f29cbe1f61f2e84ce75c Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Sat, 31 Oct 2026 23:30:36 +0000 Subject: [PATCH 4/4] [tools] Remove redundant option exclusion `HXCPP_LINK_NO_TOOL_DEPENDS` is already covered by the check above: `name.indexOf("HXCPP_LINK")>=0` --- tools/hxcpp/FileGroup.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hxcpp/FileGroup.hx b/tools/hxcpp/FileGroup.hx index 44648b702..5fbd333e4 100644 --- a/tools/hxcpp/FileGroup.hx +++ b/tools/hxcpp/FileGroup.hx @@ -209,7 +209,7 @@ class FileGroup { // Only effects linking, not compiling } - else if (name=="HXCPP_VERBOSE" || name=="HXCPP_SILENT" || name=="HXCPP_QUIET" || name=="HXCPP_TIMES" || name=="HXCPP_NEKO_BUILDTOOL" || name=="HXCPP_LINK_NO_TOOL_DEPENDS" ) + else if (name=="HXCPP_VERBOSE" || name=="HXCPP_SILENT" || name=="HXCPP_QUIET" || name=="HXCPP_TIMES" || name=="HXCPP_NEKO_BUILDTOOL") { // Does not affect build }