Skip to content

Commit

Permalink
Python: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
zeha committed Feb 16, 2024
1 parent 158bbf0 commit 29f948c
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions MagPython/MagPython.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;MAG_PY_EMBED;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;FFI_STATIC_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(OutDir)\include</AdditionalIncludeDirectories>
<!-- from python.props -->
<PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="";%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -85,7 +85,8 @@
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>version.lib;ws2_32.lib;Crypt32.lib;winmm.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>version.lib;Crypt32.lib;winmm.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>ws2_32.lib;iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<Lib>
Expand Down Expand Up @@ -499,7 +500,6 @@
<ClCompile Include="$(PythonSourceDir)\Python\compile.c" />
<ClCompile Include="$(PythonSourceDir)\Python\context.c" />
<ClCompile Include="$(PythonSourceDir)\Python\dynamic_annotations.c" />
<ClCompile Include="$(PythonSourceDir)\Python\dynload_win.c" />
<ClCompile Include="$(PythonSourceDir)\Python\errors.c" />
<ClCompile Include="$(PythonSourceDir)\Python\fileutils.c" />
<ClCompile Include="$(PythonSourceDir)\Python\flowgraph.c" />
Expand Down Expand Up @@ -560,7 +560,20 @@
<!-- END deepfreeze -->
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(PythonSourceDir)\Modules\getbuildinfo.c" />
<ClCompile Include="$(PythonSourceDir)\Modules\zlibmodule.c" />
<ClCompile Include="$(zlibDir)\adler32.c" />
<ClCompile Include="$(zlibDir)\compress.c" />
<ClCompile Include="$(zlibDir)\crc32.c" />
<ClCompile Include="$(zlibDir)\deflate.c">
<DisableSpecificWarnings>4244</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="$(zlibDir)\infback.c" />
<ClCompile Include="$(zlibDir)\inffast.c" />
<ClCompile Include="$(zlibDir)\inflate.c" />
<ClCompile Include="$(zlibDir)\inftrees.c" />
<ClCompile Include="$(zlibDir)\trees.c" />
<ClCompile Include="$(zlibDir)\uncompr.c" />
<ClCompile Include="$(zlibDir)\zutil.c" />
</ItemGroup>
<ItemGroup>
<!-- _hashlib -->
Expand Down Expand Up @@ -592,7 +605,9 @@
<!-- ctypes -->
<ClInclude Include="$(PythonSourceDir)\Modules\_ctypes\ctypes.h" />
<ClCompile Include="$(PythonSourceDir)\Modules\_ctypes\_ctypes.c" />
<ClCompile Include="$(PythonSourceDir)\Modules\_ctypes\callbacks.c" />
<ClCompile Include="$(PythonSourceDir)\Modules\_ctypes\callbacks.c">
<PreprocessorDefinitions>Py_NO_ENABLE_SHARED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="$(PythonSourceDir)\Modules\_ctypes\callproc.c" />
<ClCompile Include="$(PythonSourceDir)\Modules\_ctypes\cfield.c" />
<ClCompile Include="$(PythonSourceDir)\Modules\_ctypes\malloc_closure.c" />
Expand All @@ -602,32 +617,24 @@
<ClCompile Include="$(PythonSourceDir)\PC\dl_nt.c" />
</ItemGroup>

<!--
<ItemGroup>
<CustomBuild Include="$(PythonSourceDir)\Modules\_ctypes\libffi_msvc\win64.asm">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
<Command>ml64 /nologo /c /Zi /Fo "$(IntDir)win64.obj" "%(FullPath)"</Command>
<Outputs>$(IntDir)win64.obj;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
-->
<ItemGroup>
<Library Include="$(OutDir)\libcrypto.lib" />
<Library Include="$(OutDir)\libssl.lib" />
<Library Include="$(OutDir)\libffi.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

<Target Name="CopyArtifacts" AfterTargets="Build">
<ItemGroup>
<IncludeFile Include="$(PythonSourceDir)\PC\pyconfig.h" />
<IncludeFile Include="$(PythonSourceDir)\include\*" />
<ExtraIncludeFile Include="$(PythonSourceDir)\PC\pyconfig.h" />
<IncludeFile Include="$(PythonSourceDir)\include\**\*" />
<PythonFiles Include="$(PythonSourceDir)\lib\**\*.py" />
</ItemGroup>
<MakeDir Directories="$(OutDir)\include\Python" />
<Copy SourceFiles="@(IncludeFile)" DestinationFolder="$(OutDir)\include\Python\" />
<Copy SourceFiles="@(IncludeFile)" DestinationFolder="$(OutDir)\include\Python\" />
<Copy SourceFiles="@(ExtraIncludeFile)" DestinationFolder="$(OutDir)\include\Python\" />
<Copy SourceFiles="@(IncludeFile)" DestinationFolder="$(OutDir)\include\Python\%(RecursiveDir)" />
<Copy SourceFiles="@(PythonFiles)" DestinationFolder="$(OutDir)\lib\%(RecursiveDir)" />
</Target>
</Project>

0 comments on commit 29f948c

Please sign in to comment.