summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorZachary Ware <zach@python.org>2024-03-18 17:07:25 (GMT)
committerGitHub <noreply@github.com>2024-03-18 17:07:25 (GMT)
commit849e0716d378d6f9f724d1b3c386f6613d52a49d (patch)
tree4db4dfc15306913513a2d7f0e2c22924be6b3a27 /PCbuild
parent7707b14489644073ab0153f5751c6ddbf3fc6f91 (diff)
downloadcpython-849e0716d378d6f9f724d1b3c386f6613d52a49d.zip
cpython-849e0716d378d6f9f724d1b3c386f6613d52a49d.tar.gz
cpython-849e0716d378d6f9f724d1b3c386f6613d52a49d.tar.bz2
gh-115119: Switch Windows build to mpdecimal external (GH-115182)
This includes adding what should be a relatively temporary `Modules/_decimal/windows/mpdecimal.h` shim to choose between `mpdecimal32vc.h` or `mpdecimal64vc.h` based on which of `CONFIG_64` or `CONFIG_32` is defined.
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/_decimal.vcxproj68
-rw-r--r--PCbuild/_decimal.vcxproj.filters68
-rw-r--r--PCbuild/get_externals.bat1
-rw-r--r--PCbuild/python.props1
4 files changed, 75 insertions, 63 deletions
diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj
index 490d7df..ee74214 100644
--- a/PCbuild/_decimal.vcxproj
+++ b/PCbuild/_decimal.vcxproj
@@ -93,51 +93,55 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
- <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>BUILD_LIBMPDEC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)' == 'Win32'">CONFIG_32;PPRO;MASM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='ARM'">CONFIG_32;ANSI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='ARM64'">CONFIG_64;ANSI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)' == 'x64'">CONFIG_64;MASM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\windows;$(mpdecimalDir)\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
- <ClInclude Include="..\Modules\_decimal\libmpdec\basearith.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\bits.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\constants.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\convolute.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\crt.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\difradix2.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\basearith.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\bits.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\constants.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\convolute.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\crt.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\difradix2.h" />
<ClInclude Include="..\Modules\_decimal\docstrings.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\fnt.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\fourstep.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\mpdecimal.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\numbertheory.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\sixstep.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\transpose.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\typearith.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\umodarith.h" />
- <ClInclude Include="..\Modules\_decimal\libmpdec\vccompat.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\fnt.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\fourstep.h" />
+ <ClInclude Include="..\Modules\_decimal\windows\mpdecimal.h" />
+ <ClInclude Condition="'$(Platform)' == 'Win32'" Include="$(mpdecimalDir)\libmpdec\mpdecimal32vc.h" />
+ <ClInclude Condition="'$(Platform)' == 'ARM'" Include="$(mpdecimalDir)\libmpdec\mpdecimal32vc.h" />
+ <ClInclude Condition="'$(Platform)' == 'ARM64'" Include="$(mpdecimalDir)\libmpdec\mpdecimal64vc.h" />
+ <ClInclude Condition="'$(Platform)' == 'x64'" Include="$(mpdecimalDir)\libmpdec\mpdecimal64vc.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\numbertheory.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\sixstep.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\transpose.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\typearith.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\umodarith.h" />
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\vccompat.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Modules\_decimal\_decimal.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\basearith.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\constants.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\context.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\convolute.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\crt.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\difradix2.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\fnt.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\fourstep.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\io.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\mpalloc.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\mpdecimal.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\numbertheory.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\sixstep.c" />
- <ClCompile Include="..\Modules\_decimal\libmpdec\transpose.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\basearith.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\constants.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\context.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\convolute.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\crt.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\difradix2.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\fnt.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\fourstep.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\io.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\mpalloc.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\mpdecimal.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\numbertheory.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\sixstep.c" />
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\transpose.c" />
</ItemGroup>
<ItemGroup>
- <CustomBuild Include="..\Modules\_decimal\libmpdec\vcdiv64.asm">
+ <CustomBuild Include="$(mpdecimalDir)\libmpdec\vcdiv64.asm">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Platform)'=='ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Platform)'=='ARM64'">true</ExcludedFromBuild>
diff --git a/PCbuild/_decimal.vcxproj.filters b/PCbuild/_decimal.vcxproj.filters
index 0cbd3d0..e4bdb64 100644
--- a/PCbuild/_decimal.vcxproj.filters
+++ b/PCbuild/_decimal.vcxproj.filters
@@ -21,49 +21,55 @@
<ClInclude Include="..\Modules\_decimal\docstrings.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\basearith.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\basearith.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\bits.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\bits.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\constants.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\constants.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\convolute.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\convolute.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\crt.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\crt.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\difradix2.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\difradix2.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\fnt.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\fnt.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\fourstep.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\fourstep.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\mpdecimal.h">
+ <ClInclude Include="..\Modules\_decimal\windows\mpdecimal.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\numbertheory.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\mpdecimal32vc.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\sixstep.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\mpdecimal64vc.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\transpose.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\numbertheory.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\typearith.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\sixstep.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\umodarith.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\transpose.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
- <ClInclude Include="..\Modules\_decimal\libmpdec\vccompat.h">
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\typearith.h">
+ <Filter>Header Files\libmpdec</Filter>
+ </ClInclude>
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\umodarith.h">
+ <Filter>Header Files\libmpdec</Filter>
+ </ClInclude>
+ <ClInclude Include="$(mpdecimalDir)\libmpdec\vccompat.h">
<Filter>Header Files\libmpdec</Filter>
</ClInclude>
</ItemGroup>
@@ -71,46 +77,46 @@
<ClCompile Include="..\Modules\_decimal\_decimal.c">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\basearith.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\basearith.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\constants.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\constants.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\context.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\context.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\convolute.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\convolute.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\crt.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\crt.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\difradix2.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\difradix2.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\fnt.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\fnt.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\fourstep.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\fourstep.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\io.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\io.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\mpalloc.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\mpalloc.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\mpdecimal.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\mpdecimal.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\numbertheory.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\numbertheory.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\sixstep.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\sixstep.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\_decimal\libmpdec\transpose.c">
+ <ClCompile Include="$(mpdecimalDir)\libmpdec\transpose.c">
<Filter>Source Files\libmpdec</Filter>
</ClCompile>
</ItemGroup>
@@ -120,8 +126,8 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
- <CustomBuild Include="..\Modules\_decimal\libmpdec\vcdiv64.asm">
+ <CustomBuild Include="$(mpdecimalDir)\libmpdec\vcdiv64.asm">
<Filter>Source Files\libmpdec</Filter>
</CustomBuild>
</ItemGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
index 60ce12b..f5b7e11 100644
--- a/PCbuild/get_externals.bat
+++ b/PCbuild/get_externals.bat
@@ -54,6 +54,7 @@ set libraries=
set libraries=%libraries% bzip2-1.0.8
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.4
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.0.13
+set libraries=%libraries% mpdecimal-2.5.1
set libraries=%libraries% sqlite-3.45.1.0
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.13.1
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.13.1
diff --git a/PCbuild/python.props b/PCbuild/python.props
index e21f1f6..a8d0807 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -74,6 +74,7 @@
<libffiDir Condition="$(libffiDir) == ''">$(ExternalsDir)libffi-3.4.4\</libffiDir>
<libffiOutDir Condition="$(libffiOutDir) == ''">$(libffiDir)$(ArchName)\</libffiOutDir>
<libffiIncludeDir Condition="$(libffiIncludeDir) == ''">$(libffiOutDir)include</libffiIncludeDir>
+ <mpdecimalDir Condition="$(mpdecimalDir) == ''">$(ExternalsDir)\mpdecimal-2.5.1\</mpdecimalDir>
<opensslDir Condition="$(opensslDir) == ''">$(ExternalsDir)openssl-3.0.13\</opensslDir>
<opensslOutDir Condition="$(opensslOutDir) == ''">$(ExternalsDir)openssl-bin-3.0.13\$(ArchName)\</opensslOutDir>
<opensslIncludeDir Condition="$(opensslIncludeDir) == ''">$(opensslOutDir)include</opensslIncludeDir>