Skip to content

Commit 08804f0

Browse files
committed
Add support for Python 3.12
1 parent 361f407 commit 08804f0

221 files changed

Lines changed: 34211 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎FlexSimPy.sln‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Global
1414
Deb_3_10|x64 = Deb_3_10|x64
1515
Rel_3_10|x64 = Rel_3_10|x64
1616
Rel_3_11|x64 = Rel_3_11|x64
17+
Rel_3_12|x64 = Rel_3_12|x64
1718
Rel_3_9|x64 = Rel_3_9|x64
1819
EndGlobalSection
1920
GlobalSection(ProjectConfigurationPlatforms) = postSolution
@@ -22,18 +23,23 @@ Global
2223
{1DD065E6-F2F7-4522-AEC4-4F0D0DFBB78F}.Rel_3_10|x64.Build.0 = Rel_3_10|x64
2324
{1DD065E6-F2F7-4522-AEC4-4F0D0DFBB78F}.Rel_3_11|x64.ActiveCfg = Rel_3_11|x64
2425
{1DD065E6-F2F7-4522-AEC4-4F0D0DFBB78F}.Rel_3_11|x64.Build.0 = Rel_3_11|x64
26+
{1DD065E6-F2F7-4522-AEC4-4F0D0DFBB78F}.Rel_3_12|x64.ActiveCfg = Rel_3_12|x64
27+
{1DD065E6-F2F7-4522-AEC4-4F0D0DFBB78F}.Rel_3_12|x64.Build.0 = Rel_3_12|x64
2528
{1DD065E6-F2F7-4522-AEC4-4F0D0DFBB78F}.Rel_3_9|x64.ActiveCfg = Rel_3_9|x64
2629
{1DD065E6-F2F7-4522-AEC4-4F0D0DFBB78F}.Rel_3_9|x64.Build.0 = Rel_3_9|x64
2730
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Deb_3_10|x64.ActiveCfg = Deb_3_10|x64
2831
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_10|x64.ActiveCfg = Rel_3_10|x64
2932
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_10|x64.Build.0 = Rel_3_10|x64
3033
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_11|x64.ActiveCfg = Rel_3_11|x64
3134
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_11|x64.Build.0 = Rel_3_11|x64
35+
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_12|x64.ActiveCfg = Rel_3_12|x64
36+
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_12|x64.Build.0 = Rel_3_12|x64
3237
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_9|x64.ActiveCfg = Rel_3_9|x64
3338
{1CB9E349-A7F5-4F21-9C8A-034A7481C216}.Rel_3_9|x64.Build.0 = Rel_3_9|x64
3439
{C6A7BD76-61A9-4078-87D6-DFD568848EF8}.Deb_3_10|x64.ActiveCfg = Debug|Any CPU
3540
{C6A7BD76-61A9-4078-87D6-DFD568848EF8}.Rel_3_10|x64.ActiveCfg = Release|Any CPU
3641
{C6A7BD76-61A9-4078-87D6-DFD568848EF8}.Rel_3_11|x64.ActiveCfg = Rel_3_11|Any CPU
42+
{C6A7BD76-61A9-4078-87D6-DFD568848EF8}.Rel_3_12|x64.ActiveCfg = Rel_3_12|Any CPU
3743
{C6A7BD76-61A9-4078-87D6-DFD568848EF8}.Rel_3_9|x64.ActiveCfg = Release|Any CPU
3844
EndGlobalSection
3945
GlobalSection(SolutionProperties) = preSolution

‎FlexSimPy/FlexSimPy.vcxproj‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<Configuration>Rel_3_10</Configuration>
1414
<Platform>x64</Platform>
1515
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Rel_3_12|x64">
17+
<Configuration>Rel_3_12</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
1620
<ProjectConfiguration Include="Rel_3_7|x64">
1721
<Configuration>Rel_3_7</Configuration>
1822
<Platform>x64</Platform>
@@ -41,6 +45,15 @@
4145
<OutDir>$(ProjectDir)..\out\$(Configuration)\</OutDir>
4246
<PlatformToolset>v143</PlatformToolset>
4347
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'" Label="Configuration">
49+
<ConfigurationType>DynamicLibrary</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<WholeProgramOptimization>true</WholeProgramOptimization>
52+
<CharacterSet>MultiByte</CharacterSet>
53+
<LinkIncremental>false</LinkIncremental>
54+
<OutDir>$(ProjectDir)..\out\$(Configuration)\</OutDir>
55+
<PlatformToolset>v143</PlatformToolset>
56+
</PropertyGroup>
4457
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_10|x64'" Label="Configuration">
4558
<ConfigurationType>DynamicLibrary</ConfigurationType>
4659
<UseDebugLibraries>false</UseDebugLibraries>
@@ -89,6 +102,10 @@
89102
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
90103
<ImportGroup Label="ExtensionSettings">
91104
</ImportGroup>
105+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'" Label="PropertySheets">
106+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
107+
<Import Project="..\Python3.12.props" />
108+
</ImportGroup>
92109
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_11|x64'" Label="PropertySheets">
93110
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
94111
<Import Project="..\Python3.11.props" />
@@ -119,6 +136,11 @@
119136
<TargetName>$(ProjectName)</TargetName>
120137
<TargetExt>.pyd</TargetExt>
121138
</PropertyGroup>
139+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'">
140+
<LibraryPath>$(ProjectDir)..\python\$(PYTHON_VERSION)\lib;$(LibraryPath)</LibraryPath>
141+
<TargetName>$(ProjectName)</TargetName>
142+
<TargetExt>.pyd</TargetExt>
143+
</PropertyGroup>
122144
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_10|x64'">
123145
<LibraryPath>$(ProjectDir)..\python\$(PYTHON_VERSION)\lib;$(LibraryPath)</LibraryPath>
124146
<TargetName>$(ProjectName)</TargetName>
@@ -180,6 +202,42 @@
180202
<Command>..\PyConnector\copyheaders.bat</Command>
181203
</PreBuildEvent>
182204
</ItemDefinitionGroup>
205+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'">
206+
<ClCompile>
207+
<WarningLevel>Level2</WarningLevel>
208+
<PrecompiledHeader>
209+
</PrecompiledHeader>
210+
<Optimization>MaxSpeed</Optimization>
211+
<FunctionLevelLinking>true</FunctionLevelLinking>
212+
<IntrinsicFunctions>true</IntrinsicFunctions>
213+
<PreprocessorDefinitions>WIN32;NOMINMAX;COMPILING_FLEXSIM_CONTENT;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
214+
<AdditionalIncludeDirectories>$(ProjectDir)..\flexsimcontent;$(ProjectDir)..\python\$(PYTHON_VERSION)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
215+
<DisableSpecificWarnings>4005;4190;%(DisableSpecificWarnings)</DisableSpecificWarnings>
216+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
217+
<LanguageStandard>stdcpp20</LanguageStandard>
218+
<LanguageStandard_C>stdc17</LanguageStandard_C>
219+
<EnableModules>false</EnableModules>
220+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
221+
<WholeProgramOptimization>false</WholeProgramOptimization>
222+
</ClCompile>
223+
<Link>
224+
<SubSystem>Windows</SubSystem>
225+
<GenerateDebugInformation>true</GenerateDebugInformation>
226+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
227+
<OptimizeReferences>true</OptimizeReferences>
228+
<AdditionalDependencies>..\flexsimcontent\flexsim.lib;%(AdditionalDependencies)</AdditionalDependencies>
229+
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
230+
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
231+
<DelayLoadDLLs>FlexSim.dll</DelayLoadDLLs>
232+
</Link>
233+
<BuildLog>
234+
<Path>$(Platform)\$(Configuration)\$(MSBuildProjectName).log</Path>
235+
</BuildLog>
236+
<PreBuildEvent>
237+
<Message>Copy the latest headers from the flexsim build</Message>
238+
<Command>..\PyConnector\copyheaders.bat</Command>
239+
</PreBuildEvent>
240+
</ItemDefinitionGroup>
183241
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_10|x64'">
184242
<ClCompile>
185243
<WarningLevel>Level2</WarningLevel>

‎PyConnector/PyConnector.vcxproj‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<Configuration>Rel_3_10</Configuration>
1414
<Platform>x64</Platform>
1515
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Rel_3_12|x64">
17+
<Configuration>Rel_3_12</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
1620
<ProjectConfiguration Include="Rel_3_9|x64">
1721
<Configuration>Rel_3_9</Configuration>
1822
<Platform>x64</Platform>
@@ -24,6 +28,15 @@
2428
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2529
</PropertyGroup>
2630
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
31+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'" Label="Configuration">
32+
<ConfigurationType>DynamicLibrary</ConfigurationType>
33+
<UseDebugLibraries>false</UseDebugLibraries>
34+
<WholeProgramOptimization>true</WholeProgramOptimization>
35+
<CharacterSet>MultiByte</CharacterSet>
36+
<LinkIncremental>false</LinkIncremental>
37+
<OutDir>$(ProjectDir)..\out\</OutDir>
38+
<PlatformToolset>v143</PlatformToolset>
39+
</PropertyGroup>
2740
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_11|x64'" Label="Configuration">
2841
<ConfigurationType>DynamicLibrary</ConfigurationType>
2942
<UseDebugLibraries>false</UseDebugLibraries>
@@ -63,6 +76,10 @@
6376
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
6477
<ImportGroup Label="ExtensionSettings">
6578
</ImportGroup>
79+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'" Label="PropertySheets">
80+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
81+
<Import Project="..\Python3.12.props" />
82+
</ImportGroup>
6683
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_11|x64'" Label="PropertySheets">
6784
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
6885
<Import Project="..\Python3.11.props" />
@@ -85,6 +102,11 @@
85102
<TargetName>$(ProjectName)$(DLL_SUFFIX)</TargetName>
86103
<CustomBuildAfterTargets />
87104
</PropertyGroup>
105+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'">
106+
<LibraryPath>$(ProjectDir)..\python\$(PYTHON_VERSION)\lib;$(LibraryPath)</LibraryPath>
107+
<TargetName>$(ProjectName)$(DLL_SUFFIX)</TargetName>
108+
<CustomBuildAfterTargets />
109+
</PropertyGroup>
88110
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_10|x64'">
89111
<LibraryPath>$(ProjectDir)..\python\$(PYTHON_VERSION)\lib;$(LibraryPath)</LibraryPath>
90112
<TargetName>$(ProjectName)$(DLL_SUFFIX)</TargetName>
@@ -151,6 +173,54 @@
151173
<Message>Copy the latest headers from the flexsim build</Message>
152174
</PreBuildEvent>
153175
</ItemDefinitionGroup>
176+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_12|x64'">
177+
<ClCompile>
178+
<WarningLevel>Level2</WarningLevel>
179+
<PrecompiledHeader>
180+
</PrecompiledHeader>
181+
<Optimization>MaxSpeed</Optimization>
182+
<FunctionLevelLinking>true</FunctionLevelLinking>
183+
<IntrinsicFunctions>true</IntrinsicFunctions>
184+
<PreprocessorDefinitions>WIN32;COMPILING_FLEXSIM_CONTENT;NOMINMAX;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
185+
<AdditionalIncludeDirectories>$(ProjectDir)..\FlexSimPy;$(ProjectDir)..\flexsimcontent;$(ProjectDir)..\python\$(PYTHON_VERSION)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
186+
<DisableSpecificWarnings>4005;4190;%(DisableSpecificWarnings)</DisableSpecificWarnings>
187+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
188+
<LanguageStandard>stdcpp20</LanguageStandard>
189+
<LanguageStandard_C>stdc17</LanguageStandard_C>
190+
</ClCompile>
191+
<Link>
192+
<SubSystem>Windows</SubSystem>
193+
<GenerateDebugInformation>true</GenerateDebugInformation>
194+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
195+
<OptimizeReferences>true</OptimizeReferences>
196+
<AdditionalDependencies>..\flexsimcontent\flexsimcontent.lib;..\flexsimcontent\flexsim.lib;%(AdditionalDependencies)</AdditionalDependencies>
197+
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
198+
</Link>
199+
<BuildLog>
200+
<Path>$(Platform)\$(Configuration)\$(MSBuildProjectName).log</Path>
201+
</BuildLog>
202+
<CustomBuildStep>
203+
<Command>
204+
</Command>
205+
<Outputs>
206+
</Outputs>
207+
<TreatOutputAsContent>true</TreatOutputAsContent>
208+
<Message>
209+
</Message>
210+
</CustomBuildStep>
211+
<PostBuildEvent>
212+
<Command>copytoflexsim.bat "$(OutDir)$(TargetName)$(TargetExt)" "$(ProjectDir)..\..\..\program\python\"</Command>
213+
</PostBuildEvent>
214+
<PostBuildEvent>
215+
<Message>Copying to FlexSim Directory</Message>
216+
</PostBuildEvent>
217+
<PreBuildEvent>
218+
<Command>copyheaders.bat</Command>
219+
</PreBuildEvent>
220+
<PreBuildEvent>
221+
<Message>Copy the latest headers from the flexsim build</Message>
222+
</PreBuildEvent>
223+
</ItemDefinitionGroup>
154224
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Rel_3_10|x64'">
155225
<ClCompile>
156226
<WarningLevel>Level2</WarningLevel>

‎Python3.12.props‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ImportGroup Label="PropertySheets" />
4+
<PropertyGroup Label="UserMacros">
5+
<PYTHON_VERSION>3.12</PYTHON_VERSION>
6+
<DLL_SUFFIX>312</DLL_SUFFIX>
7+
</PropertyGroup>
8+
<PropertyGroup />
9+
<ItemDefinitionGroup />
10+
<ItemGroup>
11+
<BuildMacro Include="PYTHON_VERSION">
12+
<Value>$(PYTHON_VERSION)</Value>
13+
<EnvironmentVariable>true</EnvironmentVariable>
14+
</BuildMacro>
15+
<BuildMacro Include="DLL_SUFFIX">
16+
<Value>$(DLL_SUFFIX)</Value>
17+
<EnvironmentVariable>true</EnvironmentVariable>
18+
</BuildMacro>
19+
</ItemGroup>
20+
</Project>
62.6 KB
Binary file not shown.

‎python/3.12/include/Python.h‎

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// Entry point of the Python C API.
2+
// C extensions should only #include <Python.h>, and not include directly
3+
// the other Python header files included by <Python.h>.
4+
5+
#ifndef Py_PYTHON_H
6+
#define Py_PYTHON_H
7+
8+
// Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" {
9+
10+
// Include Python header files
11+
#include "patchlevel.h"
12+
#include "pyconfig.h"
13+
#include "pymacconfig.h"
14+
15+
#if defined(__sgi) && !defined(_SGI_MP_SOURCE)
16+
# define _SGI_MP_SOURCE
17+
#endif
18+
19+
// stdlib.h, stdio.h, errno.h and string.h headers are not used by Python
20+
// headers, but kept for backward compatibility. They are excluded from the
21+
// limited C API of Python 3.11.
22+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
23+
# include <stdlib.h>
24+
# include <stdio.h> // FILE*
25+
# include <errno.h> // errno
26+
# include <string.h> // memcpy()
27+
#endif
28+
#ifndef MS_WINDOWS
29+
# include <unistd.h>
30+
#endif
31+
#ifdef HAVE_STDDEF_H
32+
# include <stddef.h> // size_t
33+
#endif
34+
35+
#include <assert.h> // assert()
36+
#include <wchar.h> // wchar_t
37+
38+
#include "pyport.h"
39+
#include "pymacro.h"
40+
#include "pymath.h"
41+
#include "pymem.h"
42+
#include "pytypedefs.h"
43+
#include "pybuffer.h"
44+
#include "object.h"
45+
#include "objimpl.h"
46+
#include "typeslots.h"
47+
#include "pyhash.h"
48+
#include "cpython/pydebug.h"
49+
#include "bytearrayobject.h"
50+
#include "bytesobject.h"
51+
#include "unicodeobject.h"
52+
#include "cpython/initconfig.h"
53+
#include "pystate.h"
54+
#include "pyerrors.h"
55+
#include "longobject.h"
56+
#include "cpython/longintrepr.h"
57+
#include "boolobject.h"
58+
#include "floatobject.h"
59+
#include "complexobject.h"
60+
#include "rangeobject.h"
61+
#include "memoryobject.h"
62+
#include "tupleobject.h"
63+
#include "listobject.h"
64+
#include "dictobject.h"
65+
#include "cpython/odictobject.h"
66+
#include "enumobject.h"
67+
#include "setobject.h"
68+
#include "methodobject.h"
69+
#include "moduleobject.h"
70+
#include "cpython/funcobject.h"
71+
#include "cpython/classobject.h"
72+
#include "fileobject.h"
73+
#include "pycapsule.h"
74+
#include "cpython/code.h"
75+
#include "pyframe.h"
76+
#include "traceback.h"
77+
#include "sliceobject.h"
78+
#include "cpython/cellobject.h"
79+
#include "iterobject.h"
80+
#include "cpython/genobject.h"
81+
#include "descrobject.h"
82+
#include "genericaliasobject.h"
83+
#include "warnings.h"
84+
#include "weakrefobject.h"
85+
#include "structseq.h"
86+
#include "cpython/picklebufobject.h"
87+
#include "cpython/pytime.h"
88+
#include "codecs.h"
89+
#include "pythread.h"
90+
#include "cpython/context.h"
91+
#include "modsupport.h"
92+
#include "compile.h"
93+
#include "pythonrun.h"
94+
#include "pylifecycle.h"
95+
#include "ceval.h"
96+
#include "sysmodule.h"
97+
#include "osmodule.h"
98+
#include "intrcheck.h"
99+
#include "import.h"
100+
#include "abstract.h"
101+
#include "bltinmodule.h"
102+
#include "cpython/pyctype.h"
103+
#include "pystrtod.h"
104+
#include "pystrcmp.h"
105+
#include "fileutils.h"
106+
#include "cpython/pyfpe.h"
107+
#include "tracemalloc.h"
108+
109+
#endif /* !Py_PYTHON_H */

0 commit comments

Comments
 (0)