更新:1、升级编译器版本至MSVC2022,升级C++至C++17;
Signed-off-by: waiwaylee <waiwaylee@foxmail.com>
This commit is contained in:
Vendored
+10
-10
@@ -2,10 +2,10 @@
|
||||
"version": 4,
|
||||
"configurations": [
|
||||
{
|
||||
"compilerPath": "D:\\APP\\VisualStudio2013\\VC\\bin\\cl.exe",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++11",
|
||||
"intelliSenseMode": "windows-msvc-x86",
|
||||
"compilerPath": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\bin\\Hostx64\\x64\\cl.exe",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "windows-msvc-x64",
|
||||
"defines": [
|
||||
"WIN32",
|
||||
"_WINDOWS",
|
||||
@@ -20,14 +20,14 @@
|
||||
"${workspaceFolder}/data_process_class_dll/Eigen",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"name": "X256_PS (MSVC2013 x86)",
|
||||
"name": "X256_PS (MSVC2022 x64)",
|
||||
"compileCommands": "${workspaceFolder}/build/X256_PS/compile_commands.json"
|
||||
},
|
||||
{
|
||||
"compilerPath": "D:\\APP\\VisualStudio2013\\VC\\bin\\cl.exe",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++11",
|
||||
"intelliSenseMode": "windows-msvc-x86",
|
||||
"compilerPath": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\bin\\Hostx64\\x64\\cl.exe",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "windows-msvc-x64",
|
||||
"defines": [
|
||||
"WIN32",
|
||||
"_WINDOWS",
|
||||
@@ -42,7 +42,7 @@
|
||||
"${workspaceFolder}/data_process_class_dll/Eigen",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"name": "X256_MS (MSVC2013 x86)",
|
||||
"name": "X256_MS (MSVC2022 x64)",
|
||||
"compileCommands": "${workspaceFolder}/build/X256_MS/compile_commands.json"
|
||||
}
|
||||
]
|
||||
|
||||
Vendored
+2
-2
@@ -3,11 +3,11 @@ buildType:
|
||||
choices:
|
||||
release:
|
||||
short: Release
|
||||
long: Release (MSVC2013 x86)
|
||||
long: Release (MSVC2022 x64, C++17)
|
||||
buildType: Release
|
||||
debug:
|
||||
short: Debug
|
||||
long: Debug (MSVC2013 x86)
|
||||
long: Debug (MSVC2022 x64, C++17)
|
||||
buildType: Debug
|
||||
|
||||
scanMode:
|
||||
|
||||
Vendored
+12
-1
@@ -1,11 +1,22 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem CMake build script (MSVC 2022 / v143, C++17, x64)
|
||||
rem
|
||||
rem Usage: build.bat <build-dir>
|
||||
rem e.g. build.bat build\X256_PS
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
||||
rem ===========================================================================
|
||||
setlocal
|
||||
set "BUILD_DIR=%~1"
|
||||
if "%BUILD_DIR%"=="" (
|
||||
echo Usage: build.bat ^<build-dir^>
|
||||
exit /b 1
|
||||
)
|
||||
call D:\APP\VisualStudio2013\VC\vcvarsall.bat x86 >nul
|
||||
|
||||
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
||||
call "%~dp0msvc_env.bat"
|
||||
if errorlevel 1 exit /b %errorlevel%
|
||||
|
||||
cmake --build "%BUILD_DIR%"
|
||||
exit /b %errorlevel%
|
||||
|
||||
Vendored
+12
-1
@@ -1,11 +1,22 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem CMake clean script (MSVC 2022 / v143, C++17, x64)
|
||||
rem
|
||||
rem Usage: clean.bat <build-dir>
|
||||
rem e.g. clean.bat build\X256_PS
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
||||
rem ===========================================================================
|
||||
setlocal
|
||||
set "BUILD_DIR=%~1"
|
||||
if "%BUILD_DIR%"=="" (
|
||||
echo Usage: clean.bat ^<build-dir^>
|
||||
exit /b 1
|
||||
)
|
||||
call D:\APP\VisualStudio2013\VC\vcvarsall.bat x86 >nul
|
||||
|
||||
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
||||
call "%~dp0msvc_env.bat"
|
||||
if errorlevel 1 exit /b %errorlevel%
|
||||
|
||||
cmake --build "%BUILD_DIR%" --target clean
|
||||
exit /b %errorlevel%
|
||||
|
||||
Vendored
+45
-3
@@ -1,4 +1,19 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem CMake configure script (MSVC 2022 / v143, C++17, x64)
|
||||
rem
|
||||
rem Usage: configure.bat <build-dir> <PHASE_SCANNING^|MECHANICAL_SCANNING> [Debug^|Release]
|
||||
rem e.g. configure.bat build\X256_PS PHASE_SCANNING Release
|
||||
rem
|
||||
rem The generator stays "NMake Makefiles" (the choice made during the VS Code
|
||||
rem migration); cl.exe is pinned to the MSVC 2022 x64 toolset.
|
||||
rem
|
||||
rem A build directory that was configured by an older compiler (for example the
|
||||
rem MSVC 2013 cache) is removed first: neither its CMake cache nor its object
|
||||
rem files can be reused across a compiler upgrade.
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
||||
rem ===========================================================================
|
||||
setlocal
|
||||
set "BUILD_DIR=%~1"
|
||||
set "SCAN_MODE=%~2"
|
||||
@@ -12,10 +27,37 @@ if "%SCAN_MODE%"=="" (
|
||||
exit /b 1
|
||||
)
|
||||
if "%BUILD_TYPE%"=="" set "BUILD_TYPE=Release"
|
||||
call D:\APP\VisualStudio2013\VC\vcvarsall.bat x86 >nul
|
||||
|
||||
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
||||
call "%~dp0msvc_env.bat"
|
||||
if errorlevel 1 exit /b %errorlevel%
|
||||
|
||||
rem Drop a build tree left behind by another toolset.
|
||||
if not exist "%BUILD_DIR%\CMakeCache.txt" goto :configure
|
||||
set "OLD_TOOLSET="
|
||||
if exist "%BUILD_DIR%\.msvc_toolset" set /p OLD_TOOLSET=<"%BUILD_DIR%\.msvc_toolset"
|
||||
if /i "%OLD_TOOLSET%"=="%MSVC_TOOLSET_VERSION%" goto :configure
|
||||
echo [configure] "%BUILD_DIR%" was configured with MSVC toolset "%OLD_TOOLSET%" - rebuilding from scratch
|
||||
rmdir /s /q "%BUILD_DIR%"
|
||||
if exist "%BUILD_DIR%" (
|
||||
echo [ERROR] cannot remove "%BUILD_DIR%", please delete it manually and retry.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:configure
|
||||
echo [configure] compiler : %MSVC_CXX_COMPILER%
|
||||
echo [configure] build dir: %BUILD_DIR%
|
||||
echo [configure] mode : %SCAN_MODE% / %BUILD_TYPE%
|
||||
|
||||
pushd "%~dp0..\.."
|
||||
cmake -S . -B "%BUILD_DIR%" -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DRADAR_SCAN_MODE=%SCAN_MODE%
|
||||
cmake -S . -B "%BUILD_DIR%" -G "NMake Makefiles" ^
|
||||
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
|
||||
-DRADAR_SCAN_MODE=%SCAN_MODE% ^
|
||||
-DCMAKE_CXX_COMPILER="%MSVC_CXX_COMPILER%"
|
||||
set "CMAKE_EXIT=%errorlevel%"
|
||||
popd
|
||||
exit /b %CMAKE_EXIT%
|
||||
if not "%CMAKE_EXIT%"=="0" exit /b %CMAKE_EXIT%
|
||||
|
||||
rem Remember which toolset produced this build tree (checked on the next run).
|
||||
> "%BUILD_DIR%\.msvc_toolset" echo %MSVC_TOOLSET_VERSION%
|
||||
exit /b 0
|
||||
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem Shared MSVC 2022 (v143) environment setup.
|
||||
rem
|
||||
rem Called by configure.bat / build.bat / clean.bat. It:
|
||||
rem 1) locates the MSVC 2022 toolset and cl.exe (default Hostx64\x64);
|
||||
rem 2) calls vcvarsall.bat to set PATH / INCLUDE / LIB (nmake comes with it).
|
||||
rem
|
||||
rem NOTE: this script does NOT use setlocal, so the variables it defines stay
|
||||
rem in the caller's environment (all callers run under setlocal).
|
||||
rem
|
||||
rem Override the defaults with these environment variables:
|
||||
rem VS2022_DIR Visual Studio 2022 install root
|
||||
rem MSVC_TOOLSET_VERSION MSVC toolset version
|
||||
rem MSVC_HOST_ARCH compiler host architecture (x64 / x86)
|
||||
rem MSVC_TARGET_ARCH target architecture (x64 / x86)
|
||||
rem
|
||||
rem Exit code: 0 = ok, non-zero = setup failed (caller must abort).
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (cmd.exe parses .bat in the OEM code
|
||||
rem page, UTF-8 comments would break parsing on non-UTF-8 consoles).
|
||||
rem ===========================================================================
|
||||
|
||||
if not defined VS2022_DIR set "VS2022_DIR=D:\APP\VisualStudio2022"
|
||||
if not defined MSVC_TOOLSET_VERSION set "MSVC_TOOLSET_VERSION=14.44.35207"
|
||||
if not defined MSVC_HOST_ARCH set "MSVC_HOST_ARCH=x64"
|
||||
if not defined MSVC_TARGET_ARCH set "MSVC_TARGET_ARCH=x64"
|
||||
|
||||
set "MSVC_TOOLSET_DIR=%VS2022_DIR%\VC\Tools\MSVC\%MSVC_TOOLSET_VERSION%"
|
||||
set "MSVC_CXX_COMPILER=%MSVC_TOOLSET_DIR%\bin\Host%MSVC_HOST_ARCH%\%MSVC_TARGET_ARCH%\cl.exe"
|
||||
set "VCVARS_BAT=%VS2022_DIR%\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
|
||||
if not exist "%VCVARS_BAT%" (
|
||||
echo [ERROR] vcvarsall.bat not found: "%VCVARS_BAT%"
|
||||
echo Please set VS2022_DIR to the Visual Studio 2022 install root.
|
||||
exit /b 1
|
||||
)
|
||||
if not exist "%MSVC_CXX_COMPILER%" (
|
||||
echo [ERROR] cl.exe not found: "%MSVC_CXX_COMPILER%"
|
||||
echo Please check MSVC_TOOLSET_VERSION / MSVC_HOST_ARCH / MSVC_TARGET_ARCH.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
call "%VCVARS_BAT%" %MSVC_TARGET_ARCH% >nul
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] "vcvarsall.bat %MSVC_TARGET_ARCH%" failed.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
Vendored
+8
-4
@@ -2,11 +2,15 @@
|
||||
"cmake.configureOnOpen": false,
|
||||
"cmake.generator": "NMake Makefiles",
|
||||
"cmake.buildDirectory": "${workspaceFolder}/build/X256_PS",
|
||||
"cmake.configureArgs": [
|
||||
"-DCMAKE_CXX_COMPILER=D:/APP/VisualStudio2022/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe"
|
||||
],
|
||||
"cmake.environment": {
|
||||
"PATH": "D:\\APP\\VisualStudio2013\\VC\\BIN;D:\\APP\\VisualStudio2013\\Common7\\IDE;C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x86;${env:PATH}",
|
||||
"INCLUDE": "D:\\APP\\VisualStudio2013\\VC\\INCLUDE;D:\\APP\\VisualStudio2013\\VC\\ATLMFC\\INCLUDE;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt;${env:INCLUDE}",
|
||||
"LIB": "D:\\APP\\VisualStudio2013\\VC\\LIB;D:\\APP\\VisualStudio2013\\VC\\ATLMFC\\LIB;C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x86;${env:LIB}"
|
||||
"PATH": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\bin\\Hostx64\\x64;${env:PATH}",
|
||||
"INCLUDE": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\include;D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\ATLMFC\\include;D:\\APP\\VisualStudio2022\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\cppwinrt;${env:INCLUDE}",
|
||||
"LIB": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\ATLMFC\\lib\\x64;D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.26100.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.26100.0\\um\\x64;${env:LIB}"
|
||||
},
|
||||
"C_Cpp.default.cppStandard": "c++11",
|
||||
"C_Cpp.default.cppStandard": "c++17",
|
||||
"C_Cpp.default.intelliSenseMode": "windows-msvc-x64",
|
||||
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/X256_PS/compile_commands.json"
|
||||
}
|
||||
|
||||
Vendored
+8
-8
@@ -5,7 +5,7 @@
|
||||
},
|
||||
"tasks": [
|
||||
{
|
||||
"label": "CMake: 配置 X256_PS (Release, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_PS (Release, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -16,7 +16,7 @@
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "CMake: 配置 X256_PS (Debug, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_PS (Debug, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -60,7 +60,7 @@
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "CMake: 配置 X256_MS (Release, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_MS (Release, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -71,7 +71,7 @@
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "CMake: 配置 X256_MS (Debug, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_MS (Debug, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -118,7 +118,7 @@
|
||||
"label": "CMake: 配置并构建 X256_PS (Release)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_PS (Release, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_PS (Release, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_PS (Release)"
|
||||
],
|
||||
"group": {
|
||||
@@ -131,7 +131,7 @@
|
||||
"label": "CMake: 配置并构建 X256_PS (Debug)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_PS (Debug, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_PS (Debug, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_PS (Debug)"
|
||||
],
|
||||
"group": "build",
|
||||
@@ -141,7 +141,7 @@
|
||||
"label": "CMake: 配置并构建 X256_MS (Release)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_MS (Release, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_MS (Release, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_MS (Release)"
|
||||
],
|
||||
"group": "build",
|
||||
@@ -151,7 +151,7 @@
|
||||
"label": "CMake: 配置并构建 X256_MS (Debug)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_MS (Debug, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_MS (Debug, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_MS (Debug)"
|
||||
],
|
||||
"group": "build",
|
||||
|
||||
Reference in New Issue
Block a user