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/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..d838b12e7 100644 --- a/toolchain/msvc-toolchain.xml +++ b/toolchain/msvc-toolchain.xml @@ -35,9 +35,9 @@ - - - + + + @@ -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/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); } } } 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..690e993eb 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'); + } } } @@ -915,20 +919,16 @@ 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"); } } } catch(e:Dynamic){} - //if (cl_version!="") BuildTool.println("Using cl version: " + cl_version); } static function toPath(inPath:String)