Skip to content

Commit

Permalink
Use static C++ library by default (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba authored Aug 26, 2024
1 parent c36e796 commit e6803b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pymsbuild/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ class CProject(_Project):
"""
options = {
"ConfigurationType": "DynamicLibrary",
"DynamicLibcppLinkage": "false",
}

def __init__(self, name, *members, **options):
Expand Down
4 changes: 4 additions & 0 deletions pymsbuild/targets/pyd.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
<AdditionalIncludeDirectories>$(SourceRootDir.TrimEnd($(_Sep)));$(PythonIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Optimization>Full</Optimization>
<Optimization Condition="$(Configuration) == 'Debug'">Disabled</Optimization>
<RuntimeLibrary Condition="$(DynamicLibcppLinkage) == 'true'">MultiThreadedDLL</RuntimeLibrary>
<RuntimeLibrary Condition="$(DynamicLibcppLinkage) != 'true'">MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(PythonLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>True</GenerateDebugInformation>
<OutputFile>$(TargetPath)</OutputFile>
<ProgramDatabaseFile>$([System.IO.Path]::ChangeExtension('$(TargetPath)', '.pdb'))</ProgramDatabaseFile>
<AdditionalDependencies Condition="$(DynamicLibcppLinkage) != 'true'">ucrt.lib;vcruntime.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries Condition="$(DynamicLibcppLinkage) != 'true'">libucrt.lib;libvcruntime.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<Lib>
<OutputFile>$(TargetPath)</OutputFile>
Expand Down

0 comments on commit e6803b9

Please sign in to comment.