From 3946b12f77869af53b3b84e834c49aa3b21e9073 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 16 Oct 2026 17:38:37 +0100 Subject: [PATCH 1/5] Remove references to vs2013 builds vs2013 didn't fully implement c++11. In particular, it is missing proper char16_t support, so it was no longer possible to use it to build hxcpp since: 523cee145dff6c6ef12a4f2b096b8063e589206b > D:/a/hxcpp/hxcpp/include\hx/LessThanEq.h(98) : error C2766: explicit specialization; 'hx::CompareTraits' has already been defined > D:/a/hxcpp/hxcpp/include\hx/LessThanEq.h(93) : see previous definition of 'CompareTraits' Since then, more char16_t initialisations have been added, and now constexpr is used, so the codebase has been incompatible with vs2013 for a long time. --- hxcpp/Builder.hx | 2 -- toolchain/finish-setup.xml | 15 +++--------- toolchain/msvc-setup.bat | 47 ------------------------------------ toolchain/msvc-toolchain.xml | 7 +++--- toolchain/msvc64-setup.bat | 12 +-------- tools/hxcpp/BuildTool.hx | 26 +++++++++----------- tools/hxcpp/Linker.hx | 16 +----------- tools/hxcpp/Setup.hx | 13 ++++------ 8 files changed, 24 insertions(+), 114 deletions(-) diff --git a/hxcpp/Builder.hx b/hxcpp/Builder.hx index 539e546d4..fdc25fab8 100644 --- a/hxcpp/Builder.hx +++ b/hxcpp/Builder.hx @@ -146,11 +146,9 @@ class Builder case "msvc": if (isStatic) { - validArchs.set("2013m32", ["-D"+target, "-DHXCPP_M32", "HXCPP_MSVC_VER=120"].concat(staticFlags) ); validArchs.set("2015m32", ["-D"+target, "-DHXCPP_M32", "HXCPP_MSVC_VER=140"].concat(staticFlags) ); if (wantWindows64()) { - validArchs.set("2013m64", ["-D"+target, "-DHXCPP_M64", "HXCPP_MSVC_VER=120"].concat(staticFlags) ); validArchs.set("2015m64", ["-D"+target, "-DHXCPP_M64", "HXCPP_MSVC_VER=140"].concat(staticFlags) ); } } diff --git a/toolchain/finish-setup.xml b/toolchain/finish-setup.xml index 1e814ade3..326c1258f 100644 --- a/toolchain/finish-setup.xml +++ b/toolchain/finish-setup.xml @@ -98,19 +98,10 @@ - + - - - -
- - - - - - -
+ + diff --git a/toolchain/msvc-setup.bat b/toolchain/msvc-setup.bat index 8a8f89bfd..ced632504 100644 --- a/toolchain/msvc-setup.bat +++ b/toolchain/msvc-setup.bat @@ -37,53 +37,6 @@ if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( ) @echo HXCPP_VARS @set -) else if exist "%VS120COMNTOOLS%\vsvars32.bat" ( - @call "%VS120COMNTOOLS%\vsvars32.bat" - @if defined HXCPP_WINXP_COMPAT ( - @if exist "%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\" ( - @set "INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Include;!INCLUDE!" - @set "PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Bin;!PATH!" - @set "LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Lib;!LIB!" - ) else if exist "%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\" ( - @set "INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;!INCLUDE!" - @set "PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;!PATH!" - @set "LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;!LIB!" - ) - - @set HXCPP_XP_DEFINE=_USING_V120_SDK71_ - ) - @echo HXCPP_VARS - @set -) else if exist "%VS110COMNTOOLS%\vsvars32.bat" ( - @call "%VS110COMNTOOLS%\vsvars32.bat" - @if defined HXCPP_WINXP_COMPAT ( - @set "INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;!INCLUDE!" - @set "PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Bin;!PATH!" - @set "LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Lib;!LIB!" - @set HXCPP_XP_DEFINE=_USING_V110_SDK71_ - ) - @echo HXCPP_VARS - @set -) else if exist "%VS100COMNTOOLS%\vsvars32.bat" ( - @call "%VS100COMNTOOLS%\vsvars32.bat" - @echo HXCPP_VARS - @set -) else if exist "%VS90COMNTOOLS%\vsvars32.bat" ( - @call "%VS90COMNTOOLS%\vsvars32.bat" - @echo HXCPP_VARS - @set -) else if exist "%VS80COMNTOOLS%\vsvars32.bat" ( - @call "%VS80COMNTOOLS%\vsvars32.bat" - @echo HXCPP_VARS - @set -) else if exist "%VS71COMNTOOLS%\vsvars32.bat" ( - @call "%VS71COMNTOOLS%\vsvars32.bat" - @echo HXCPP_VARS - @set -) else if exist "%VS70COMNTOOLS%\vsvars32.bat" ( - @call "%VS70COMNTOOLS%\vsvars32.bat" - @echo HXCPP_VARS - @set ) else ( echo Warning: Could not find environment variables for Visual Studio ) diff --git a/toolchain/msvc-toolchain.xml b/toolchain/msvc-toolchain.xml index fc2383848..b8db13638 100644 --- a/toolchain/msvc-toolchain.xml +++ b/toolchain/msvc-toolchain.xml @@ -49,16 +49,15 @@ - - - - + + + diff --git a/toolchain/msvc64-setup.bat b/toolchain/msvc64-setup.bat index 5ad797c58..b58ed7dbd 100644 --- a/toolchain/msvc64-setup.bat +++ b/toolchain/msvc64-setup.bat @@ -33,16 +33,6 @@ setlocal enabledelayedexpansion @echo HXCPP_VARS @set @echo HXCPP_HACK_PDBSRV=1 -) else if exist "%VS120COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" ( - @echo "%VS120COMNTOOLS%" - @call "%VS120COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" - @echo HXCPP_VARS - @set -) else if exist "%VS110COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" ( - @echo "%VS110COMNTOOLS%" - @call "%VS110COMNTOOLS%\..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" - @echo HXCPP_VARS - @set ) else ( echo Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths -) \ No newline at end of file +) diff --git a/tools/hxcpp/BuildTool.hx b/tools/hxcpp/BuildTool.hx index cd5a48f5b..c4724d5d1 100644 --- a/tools/hxcpp/BuildTool.hx +++ b/tools/hxcpp/BuildTool.hx @@ -75,7 +75,6 @@ class BuildTool var defaultObjCxxStandard:Null; public static var os=""; - public static var sAllowNumProcs = true; public static var sCompileThreadCount = 1; public static var sThreadPool:ThreadPool; public static var sReportedThreads = -1; @@ -201,8 +200,8 @@ class BuildTool if (isMsvc()) { mDefines.set("isMsvc","1"); - if (Std.parseInt(mDefines.get("MSVC_VER"))>=18) - mDefines.set("MSVC18+","1"); + // deprecated + mDefines.set("MSVC18+","1"); } include("toolchain/finish-setup.xml", false); @@ -365,19 +364,16 @@ class BuildTool if (instance!=null) { var defs = instance.mDefines; - if (sAllowNumProcs) - { - var thread_var = defs.exists("HXCPP_COMPILE_THREADS") ? - defs.get("HXCPP_COMPILE_THREADS") : Sys.getEnv("HXCPP_COMPILE_THREADS"); + var thread_var = defs.exists("HXCPP_COMPILE_THREADS") ? + defs.get("HXCPP_COMPILE_THREADS") : Sys.getEnv("HXCPP_COMPILE_THREADS"); - if (thread_var == null) - { - sCompileThreadCount = getNumberOfProcesses(); - } - else - { - sCompileThreadCount = (Std.parseInt(thread_var)<2) ? 1 : Std.parseInt(thread_var); - } + if (thread_var == null) + { + sCompileThreadCount = getNumberOfProcesses(); + } + else + { + sCompileThreadCount = (Std.parseInt(thread_var)<2) ? 1 : Std.parseInt(thread_var); } if (sCompileThreadCount>1 && sThreadPool==null) sThreadPool = new ThreadPool(sCompileThreadCount); diff --git a/tools/hxcpp/Linker.hx b/tools/hxcpp/Linker.hx index 78436a4a9..9f49ca7be 100644 --- a/tools/hxcpp/Linker.hx +++ b/tools/hxcpp/Linker.hx @@ -151,21 +151,7 @@ class Linker } else { - var v18 = parts[0] + "-18" + parts[1]; - if (FileSystem.exists(v18)) - { - Log.info("", " - \x1b[1mUsing MSVC18 compatible library:\x1b[0m " + v18); - libs[i]=v18; - if (!v18Added) - { - v18Added=true; - libs.push( BuildTool.HXCPP + "/lib/Windows/libmsvccompat-18.lib"); - } - } - else - { - Log.error("Could not find compatible library for " + lib + ", " + v18 + " does not exist"); - } + Log.error("Could not find compatible library for " + lib + ", " + current + " does not exist"); } } else diff --git a/tools/hxcpp/Setup.hx b/tools/hxcpp/Setup.hx index 9b16ff801..2ba16d86c 100644 --- a/tools/hxcpp/Setup.hx +++ b/tools/hxcpp/Setup.hx @@ -915,15 +915,12 @@ class Setup var cl_version = Std.parseInt(reg.matched(1)); Log.setup("Using MSVC version: " + cl_version); ioDefines.set("MSVC_VER", cl_version+""); - if (cl_version>=17) - ioDefines.set("MSVC17+","1"); - if (cl_version>=18) - ioDefines.set("MSVC18+","1"); - if (cl_version==19) - ioDefines.set("MSVC19","1"); - BuildTool.sAllowNumProcs = cl_version >= 14; + // deprecated + ioDefines.set("MSVC17+","1"); + ioDefines.set("MSVC18+","1"); + ioDefines.set("MSVC19","1"); var threads = BuildTool.getThreadCount(); - if (threads>1 && cl_version>=18) + if (threads>1) ioDefines.set("HXCPP_FORCE_PDB_SERVER","1"); } } From ae3bb65a04171ba5389170cb2996ac4d5235a1bb Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 16 Oct 2026 17:56:11 +0100 Subject: [PATCH 2/5] Add error for ancient HXCPP_MSVC_VER I'm not really sure what the "Using specified MSVC Ver" path is for, it seems to treat the HXCPP_MSVC_VER as a path and sets the string value directly to HXCPP_MSVC. In that case ival should be null, since a path cannot be parsed as an int. --- tools/hxcpp/Setup.hx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/hxcpp/Setup.hx b/tools/hxcpp/Setup.hx index 2ba16d86c..3affdfb63 100644 --- a/tools/hxcpp/Setup.hx +++ b/tools/hxcpp/Setup.hx @@ -791,7 +791,7 @@ class Setup else { var ival = Std.parseInt(ioDefines.get("HXCPP_MSVC_VER")); - if (ival>0) + if (ival>=140) { var varName = "VS" + ival+ "COMNTOOLS"; var where = Sys.getEnv(varName); @@ -812,12 +812,16 @@ class Setup Sys.putEnv("HXCPP_MSVC", where); Log.setup('Using MSVC Ver $ival in $where ($varName)'); } - else + else if (ival == null) { Log.setup('Using specified MSVC Ver $val'); ioDefines.set("HXCPP_MSVC", val ); Sys.putEnv("HXCPP_MSVC", val); } + else + { + Log.error('HXCPP_MSVC_VER ${ival} is not supported'); + } } } From ec046058b46863efc75c24d8aa3a72a266a07d1c Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 16 Oct 2026 18:01:34 +0100 Subject: [PATCH 3/5] Remove old MSVC_VER support from GenMsvc.hx --- tools/hxcpp/GenMsvc.hx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tools/hxcpp/GenMsvc.hx b/tools/hxcpp/GenMsvc.hx index 4f227fa1d..ce3e39570 100755 --- a/tools/hxcpp/GenMsvc.hx +++ b/tools/hxcpp/GenMsvc.hx @@ -58,23 +58,9 @@ class GenMsvc platformToolset = "v143"; vsVersion = "17"; } - else if (ver >= 18) - { - // cl.exe 18.x = VS 2013 - platformToolset = "v120"; - vsVersion = "12"; - } - else if (ver >= 17) - { - // cl.exe 17.x = VS 2012 - platformToolset = "v110"; - vsVersion = "11"; - } else { - // Older versions - platformToolset = "v100"; - vsVersion = "10"; + Log.error('Unsupported MSVC_VER: ' + ver); } } } From 2fdc37d1e2937d565c153cc1f980b62b57d65851 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Fri, 16 Oct 2026 18:03:07 +0100 Subject: [PATCH 4/5] Remove old commented out block The version is printed already above --- tools/hxcpp/Setup.hx | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/hxcpp/Setup.hx b/tools/hxcpp/Setup.hx index 3affdfb63..690e993eb 100644 --- a/tools/hxcpp/Setup.hx +++ b/tools/hxcpp/Setup.hx @@ -929,7 +929,6 @@ class Setup } } } catch(e:Dynamic){} - //if (cl_version!="") BuildTool.println("Using cl version: " + cl_version); } static function toPath(inPath:String) From d67d81611377028ad3f30ac691eb3fce64421e10 Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Mon, 19 Oct 2026 23:01:55 +0100 Subject: [PATCH 5/5] Remove MSVC_VER from obj dir With vs2013 support dropped, this version will always be 19 so we no longer need to add it to differentiate object directories. --- docs/build_xml/Compiler.md | 2 +- toolchain/msvc-toolchain.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/build_xml/Compiler.md b/docs/build_xml/Compiler.md index f44de8990..cabcb856f 100755 --- a/docs/build_xml/Compiler.md +++ b/docs/build_xml/Compiler.md @@ -39,7 +39,7 @@ Compilers are run over each of the changed files in each of the filegroups in a ```xml ``` - + value = usually built programmatically, like `obj/msvc${MSVC_VER}-rt${OBJEXT}${OBJCACHE}${XPOBJ}` + + value = usually built programmatically, like `obj/msvc-rt${OBJEXT}${OBJCACHE}${XPOBJ}` - *output* - Flag used to specifying compiler output name. ```xml diff --git a/toolchain/msvc-toolchain.xml b/toolchain/msvc-toolchain.xml index b8db13638..d838b12e7 100644 --- a/toolchain/msvc-toolchain.xml +++ b/toolchain/msvc-toolchain.xml @@ -35,9 +35,9 @@ - - - + + +