@@ -127,6 +127,29 @@ def mainw_exe(name):
127127 )
128128
129129
130+ def pyshellext (platform ):
131+ return CProject (f"pyshellext-{ platform } " ,
132+ VersionInfo (
133+ FileDescription = "Python shell extension" ,
134+ OriginalFilename = f"pyshellext.{ platform } .dll" ,
135+ ),
136+ Property ('StaticLibcppLinkage' , 'true' ),
137+ ItemDefinition ('ClCompile' , LanguageStandard = 'stdcpp20' ),
138+ ItemDefinition ('Link' ,
139+ AdditionalDependencies = Prepend ("RuntimeObject.lib;" ),
140+ SubSystem = 'WINDOWS' ,
141+ ModuleDefinitionFile = '$(SourceRootDir)src\\ pyshellext\\ pyshellext.def' ,
142+ ),
143+ Manifest ('default.manifest' ),
144+ CSourceFile ('shellext.cpp' ),
145+ ResourceFile ('pyshellext.rc' ),
146+ SourceFile ('pyshellext.def' ),
147+ source = 'src/pyshellext' ,
148+ Platform = platform ,
149+ TargetName = f"pyshellext.{ platform } " ,
150+ )
151+
152+
130153PACKAGE = Package ('python-manager' ,
131154 PyprojectTomlFile ('pyproject.toml' ),
132155 # MSIX manifest
@@ -149,8 +172,7 @@ def mainw_exe(name):
149172 CProject ('launcher' ,
150173 VersionInfo (FileDescription = "Python launcher" , OriginalFilename = "launcher.exe" ),
151174 CPP_SETTINGS ,
152- Property ('DynamicLibcppLinkage' , 'true' ),
153- ItemDefinition ('ClCompile' , RuntimeLibrary = 'MultiThreaded' ),
175+ Property ('StaticLibcppLinkage' , 'true' ),
154176 ItemDefinition ('Link' , SubSystem = 'CONSOLE' ),
155177 Manifest ('default.manifest' ),
156178 ResourceFile ('pyicon.rc' ),
@@ -163,8 +185,7 @@ def mainw_exe(name):
163185 CProject ('launcherw' ,
164186 VersionInfo (FileDescription = "Python launcher (windowed)" , OriginalFilename = "launcherw.exe" ),
165187 CPP_SETTINGS ,
166- Property ('DynamicLibcppLinkage' , 'true' ),
167- ItemDefinition ('ClCompile' , RuntimeLibrary = 'MultiThreaded' ),
188+ Property ('StaticLibcppLinkage' , 'true' ),
168189 ItemDefinition ('Link' , SubSystem = 'WINDOWS' ),
169190 Manifest ('default.manifest' ),
170191 ResourceFile ('pywicon.rc' ),
@@ -203,27 +224,8 @@ def mainw_exe(name):
203224 main_exe ("python3" ),
204225 mainw_exe ("pythonw3" ),
205226
206- CProject ("pyshellext" ,
207- VersionInfo (
208- FileDescription = "Python shell extension" ,
209- OriginalFilename = "pyshellext.dll" ,
210- ),
211- Property ('DynamicLibcppLinkage' , 'true' ),
212- ItemDefinition ('ClCompile' ,
213- LanguageStandard = 'stdcpp20' ,
214- RuntimeLibrary = 'MultiThreaded' ,
215- ),
216- ItemDefinition ('Link' ,
217- AdditionalDependencies = Prepend ("RuntimeObject.lib;" ),
218- SubSystem = 'WINDOWS' ,
219- ModuleDefinitionFile = '$(SourceRootDir)src\\ pyshellext\\ pyshellext.def' ,
220- ),
221- Manifest ('default.manifest' ),
222- CSourceFile ('shellext.cpp' ),
223- ResourceFile ('pyshellext.rc' ),
224- SourceFile ('pyshellext.def' ),
225- source = 'src/pyshellext' ,
226- )
227+ pyshellext ("x64" ),
228+ pyshellext ("arm64" ),
227229)
228230
229231
0 commit comments