@echo Off @setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION :: set _DRY_RUN=/N set _MAKEFILE=makefile.vc set _MAKE=nmake set _ARCH=64 set _WXDLLS=\lib\vc_x64_dll if "%1" == "" if NOT DEFINED WXWIN goto NoTargetSpecified if NOT "%1" == "" SET WXWIN=%~1 if NOT EXIST "!WXWIN!\build\msw" goto InvalidTargetSpecified set _WXVER=!WXWIN:*-=! echo :: Scanning for wxVersion=!_WXVER! :: Depending on the version, the structure of the test directory :: names of the samples will change. if "!_WXVER!" == "3.0.5" ( set _WXTESTU=vc_mswu_x64 set _WXTESTUD=vc_mswud_x64 set _WXTESTUDLL=vc_mswudll_x64 set _WXTESTUDDLL=vc_mswuddll_x64 set _WXUSEOPENGL=1 goto :VersionMatched ) if "!_WXVER!" == "3.1.5" ( set _WXTESTU=vc_mswu_x64 set _WXTESTUD=vc_mswud_x64 set _WXTESTUDLL=vc_mswudll_x64 set _WXTESTUDDLL=vc_mswuddll_x64 set _WXUSEOPENGL=0 goto :VersionMatched ) if "!_WXVER!" == "3.1.7" ( set _WXTESTU=vc_x64_mswu set _WXTESTUD=vc_x64_mswud set _WXTESTUDLL=vc_x64_mswudll set _WXTESTUDDLL=vc_x64_mswuddll set _WXUSEOPENGL=0 goto :VersionMatched ) if "!_WXVER!" == "3.2.0" ( set _WXTESTU=vc_x64_mswu set _WXTESTUD=vc_x64_mswud set _WXTESTUDLL=vc_x64_mswudll set _WXTESTUDDLL=vc_x64_mswuddll set _WXUSEOPENGL=0 goto :VersionMatched ) if "!_WXVER!" == "3.2.1" ( set _WXTESTU=vc_x64_mswu set _WXTESTUD=vc_x64_mswud set _WXTESTUDLL=vc_x64_mswudll set _WXTESTUDDLL=vc_x64_mswuddll set _WXUSEOPENGL=1 goto :VersionMatched ) if "!_WXVER!" == "3.2.2.1" ( set _WXTESTU=vc_x64_mswu set _WXTESTUD=vc_x64_mswud set _WXTESTUDLL=vc_x64_mswudll set _WXTESTUDDLL=vc_x64_mswuddll set _WXUSEOPENGL=1 goto :VersionMatched ) if "!_WXVER!" == "3.2.6" ( set _WXTESTU=vc_x64_mswu set _WXTESTUD=vc_x64_mswud set _WXTESTUDLL=vc_x64_mswudll set _WXTESTUDDLL=vc_x64_mswuddll set _WXUSEOPENGL=1 goto :VersionMatched ) if "!_WXVER!" == "3.2.7" ( set _WXTESTU=vc_x64_mswu set _WXTESTUD=vc_x64_mswud set _WXTESTUDLL=vc_x64_mswudll set _WXTESTUDDLL=vc_x64_mswuddll set _WXUSEOPENGL=1 goto :VersionMatched ) echo :: echo :: The version number was unable to be detected echo :: Expected directory name to be fully-qualified of the structure echo :: echo :: ^^:^<\path-to-lib^>\^-^ where: echo :: ^ = wxWidgets echo :: ^ = ^(3.0.5 ^| 3.1.5 ^| 3.1.7 ^| 3.2.0 ^| 3.2.1 ^| 3.2.2.1 ^| 3.2.6 ^| 3.2.7 ^) echo :: goto FAIL :VersionMatched echo :: echo :: Building wxWidgets !_WXVER! for Visual Studio 64-bit echo :: :: Building Visual Studio Version of wxWidgets :: %1 = Top Level Directory :: %2 = Switches :: Uncomment for vs2019 :: cd /d "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" :: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" :: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" :: Uncomment for vs2022 cd /d "C:\Program Files\Microsoft Visual Studio\2022\Community\" call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars!_ARCH!.bat" WHERE /Q !_MAKE! if NOT !ERRORLEVEL! EQU 0 goto MissingMake :: :: Now build up and test each of the 4 supported combinations :: :: SHARED TYPE RUNTIME_LIBS Description TestDir Use OpenGL :: ------ ------- ------------ -------------------- ------------ ---------------- Call :BuildAndTest 0 debug "static" "Static Debug" "!_WXTESTUD!" "!_WXUSEOPENGL!" Call :BuildAndTest 0 release "static" "Static Release" "!_WXTESTU!" "!_WXUSEOPENGL!" Call :BuildAndTest 1 debug "dynamic" "Shared/DLL Debug" "!_WXTESTUDDLL!" "!_WXUSEOPENGL!" Call :BuildAndTest 1 release "dynamic" "Shared/DLL Release" "!_WXTESTUDLL!" "!_WXUSEOPENGL!" Goto SUCCESS :BuildAndTest echo :: echo :: Building %~4 Configuration with C^+^+17 Support echo :: cd /d !WXWIN!\build\MSW set _MakeCommand=!_MAKE! !_DRY_RUN! -f !_MAKEFILE! SHARED=%~1 BUILD=%~2 CXXFLAGS="/std:c++17" USE_OPENGL=%~6 RUNTIME_LIBS="%~3" TARGET_CPU=X!_ARCH! !_MakeCommand! setup_h IF %ERRORLEVEL% NEQ 0 goto FAIL !_MakeCommand! IF %ERRORLEVEL% NEQ 0 goto FAIL echo :: echo :: Testing Minimal.EXE ^[%~4^] echo :: Build / Test will continue when application exits echo :: setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION cd /d !WXWIN!\samples\minimal !_MakeCommand! clean !_MakeCommand! cd /d !WXWIN!\samples\minimal\%5 if "%~1" == "0" goto SkipDLLs path !WXWIN!!_WXDLLS!;%PATH% :SkipDLLs minimal.exe endlocal exit /b :MissingMake echo :: %~nx0 (Usage) echo :: The required command ^[!_MAKE!^] does not exist. echo :: goto FAIL :InvalidTargetSpecified echo :: %~nx0 (Usage) echo :: The Specified Target ^[!WXWIN!^] does not have a subpath of \build\msw or does not exist. echo :: goto FAIL :NoTargetSpecified echo :: %~nx0 (Usage) echo :: There was no build target specified echo :: echo :: You may echo :: (a) use this file as a "Drop Target" for the wxWidgets base directory echo :: (b) Define the environment variable WXWIN to point to the wxWidgets base directory echo :: goto FAIL :FAIL echo :: Build failed, see above why. echo :: ^[NOTE^] Running parallel jobs may cause occasional synchronization failures... echo :: You should attempt to rebuild again until it's successful. pause goto FINISHED :SUCCESS :FINISHED endlocal echo :: (End Run %~nx0) PAUSE