Updated build settings

This commit is contained in:
Ladislav Zezula
2024-11-19 09:04:36 +01:00
parent 86f9b99ffe
commit e10150c8c3
5 changed files with 40 additions and 26 deletions

View File

@@ -71,9 +71,9 @@
<ProjectGuid>{78424708-1F6E-4D4B-920C-FB6D26847055}</ProjectGuid>
<RootNamespace>StormLib</RootNamespace>
<XPDeprecationWarning>false</XPDeprecationWarning>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

View File

@@ -155,6 +155,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -179,6 +180,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX64</TargetMachine>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

View File

@@ -214,6 +214,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/PDBALTPATH:%_PDB%"
OutputFile="$(OutDir)\StormLib.dll"
LinkIncremental="1"
ModuleDefinitionFile=".\src\DllMain.def"
@@ -291,6 +292,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/PDBALTPATH:%_PDB%"
OutputFile="$(OutDir)\StormLib.dll"
LinkIncremental="1"
ModuleDefinitionFile=".\src\DllMain.def"

View File

@@ -14,7 +14,7 @@ if exist "%ProgramFiles%" set PROGRAM_FILES_DIR=%ProgramFiles%
if exist "%ProgramFiles(x86)%" set PROGRAM_FILES_DIR=%ProgramFiles(x86)%
:: Determine the installed version of Visual Studio (Enterprise > Professional > Community)
::if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" set VCVARS_2008=%PROGRAM_FILES_DIR%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" set VCVARS_2008=%PROGRAM_FILES_DIR%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" set VCVARS_20xx=%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" set VCVARS_20xx=%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat
if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" set VCVARS_20xx=%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
@@ -26,8 +26,8 @@ if exist "%PROGRAM_FILES_X64%\Microsoft Visual Studio\2022\Professional\VC\Auxil
if exist "%PROGRAM_FILES_X64%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" set VCVARS_20xx=%PROGRAM_FILES_X64%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat
:: Build all libraries using Visual Studio 2008 and 202x
if not "x%VCVARS_2008%" == "x" call :BuildLibs "%VCVARS_2008%" x86 %LIB_NAME%_vs08.sln \vs2008
if not "x%VCVARS_2008%" == "x" call :BuildLibs "%VCVARS_2008%" x64 %LIB_NAME%_vs08.sln \vs2008
if not "x%VCVARS_2008%" == "x" call :BuildLibs "%VCVARS_2008%" x86 %LIB_NAME%_vs08.sln vs2008
if not "x%VCVARS_2008%" == "x" call :BuildLibs "%VCVARS_2008%" x64 %LIB_NAME%_vs08.sln vs2008
if not "x%VCVARS_20xx%" == "x" call :BuildLibs "%VCVARS_20xx%" x86 %LIB_NAME%.sln
if not "x%VCVARS_20xx%" == "x" call :BuildLibs "%VCVARS_20xx%" x64 %LIB_NAME%.sln
goto:eof
@@ -47,18 +47,18 @@ goto:eof
if not exist %1 goto:eof
call %1 %2
if "%2" == "x86" set SLN_TRG=Win32
if "%2" == "x86" set LIB_TRG=lib32%4
if "%2" == "x86" set LIB_TRG=lib32\%4
if "%2" == "x64" set SLN_TRG=x64
if "%2" == "x64" set LIB_TRG=lib64%4
if "%2" == "x64" set LIB_TRG=lib64\%4
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% DebugAD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% DebugAS
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% DebugUD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% DebugUS
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% ReleaseAD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% ReleaseAS
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% ReleaseUD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% ReleaseUS
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%DAD DebugAD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%DAS DebugAS
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%DUD DebugUD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%DUS DebugUS
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%RAD ReleaseAD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%RAS ReleaseAS
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%RUD ReleaseUD
call :BuildAndCopyLib %3 %SLN_TRG% %LIB_TRG% %LIB_NAME%RUS ReleaseUS
:: Restore environment variables to the old values
set INCLUDE=%SAVE_INCLUDE%
@@ -82,14 +82,17 @@ goto:eof
:: %1 Plain name of the .sln solution file
:: %2 Target build platform ("Win32" or "x64")
:: %3 Target directory for the library ("lib32", "lib32\vs2008", "lib64" or "lib64\vs2008")
:: %4 Subvariant of the library ("DebugAD", "ReleaseUS", ...)
:: %4 Base name of the target, such as CascLibDAD
:: %5 Subvariant of the library ("DebugAD", "ReleaseUS", ...)
::
:BuildAndCopyLib
if not exist %1 goto:eof
devenv.com %1 /project "%LIB_NAME%" /rebuild "%4|%2"
devenv.com %1 /project "%LIB_NAME%" /rebuild "%5|%2"
if not exist ..\aaa goto:eof
xcopy.exe /Y /D .\src\StormLib.h ..\aaa\inc >nul
xcopy.exe /Y /D .\src\StormPort.h ..\aaa\inc >nul
xcopy.exe /Y /D .\bin\StormLib\%2\%4\*.lib ..\aaa\%3 >nul
if not exist ..\aaa\inc md ..\aaa\inc
if not exist ..\aaa\%3 md ..\aaa\%3
copy /Y /D .\src\StormLib.h ..\aaa\inc >nul
copy /Y /D .\src\StormPort.h ..\aaa\inc >nul
copy /Y /D .\bin\StormLib\%2\%5\%4.lib ..\aaa\%3\%4.lib >nul
copy /Y /D .\bin\StormLib\%2\%5\%4.pdb ..\aaa\%3\%4.pdb >nul

View File

@@ -9,6 +9,7 @@ goto:eof
:SELECT_LIB
set PROJECT_DIR=%~dp0
set LIBRARY_NAME=StormLibWDK
set SAVE_PATH=%PATH%
:PREPARE_SOURCES
echo Preparing sources ...
@@ -34,13 +35,19 @@ build.exe -czgw
del buildfre_wlh_amd64.log
echo.
:COPY_LIBS
xcopy /Y /D .\src\StormLib.h ..\aaa\inc >nul
xcopy /Y /D .\src\StormPort.h ..\aaa\inc >nul
xcopy /Y /D .\objfre_w2k_x86\i386\%LIBRARY_NAME%.lib ..\aaa\lib32\%LIBRARY_NAME%.lib >nul
xcopy /Y /D .\objfre_wlh_amd64\amd64\%LIBRARY_NAME%.lib ..\aaa\lib64\%LIBRARY_NAME%.lib >nul
:COPY_OUTPUT
if not exist ..\aaa goto CLEANUP
if not exist ..\aaa\inc md ..\aaa\inc
if not exist ..\aaa\lib32 md ..\aaa\lib32
if not exist ..\aaa\lib64 md ..\aaa\lib64
copy /Y .\src\StormLib.h ..\aaa\inc >nul
copy /Y .\src\StormPort.h ..\aaa\inc >nul
copy /Y .\objfre_wlh_amd64\amd64\%LIBRARY_NAME%.lib ..\aaa\lib64\%LIBRARY_NAME%.lib >nul
copy /Y .\objfre_w2k_x86\i386\%LIBRARY_NAME%.lib ..\aaa\lib32\%LIBRARY_NAME%.lib >nul
:CLEANUP
if exist sources-cpp.cpp del sources-cpp.cpp
if exist sources-wdk-* del sources-wdk-*
if exist build.bat del build.bat
set PATH=%SAVE_PATH%
set SAVE_PATH=