Skip to content

Commit 13943cc

Browse files
committed
docs(compile): reorder a bit
1 parent 1e1f90d commit 13943cc

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

source/guides/packaging-binary-extensions.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -238,26 +238,26 @@ Binary extensions for Windows
238238
Before it is possible to build a binary extension, it is necessary to ensure
239239
that you have a suitable compiler available. On Windows, Visual C is used to
240240
build the official CPython interpreter, and should be used to build compatible
241-
binary extensions.
241+
binary extensions. To set up a build environment for binary extensions, install
242+
`Visual Studio Community Edition <https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx>`__
243+
- any recent version is fine.
244+
245+
One caveat: if you use Visual Studio 2019 or later, your extension will depend
246+
on an "extra" file, ``VCRUNTIME140_1.dll``, in addition to the
247+
``VCRUNTIME140.dll`` that all previous versions back to 2015 depend on. This
248+
will add an extra requirement to using your extension on versions of CPython
249+
that do not include this extra file. To avoid this, you can add the
250+
compile-time argument ``/d2FH4-``. Recent versions of Python may include this
251+
file.
242252

243253
Building for Python prior to 3.5 is discouraged, because older versions of
244-
Visual Studio are no longer available from Microsoft. If you do
245-
need to build for older versions, you can set ``DISTUTILS_USE_SDK=1`` and
246-
``MSSdk=1`` to force a the currently activated version of MSVC to be found,
247-
and you should exercise care when designing your extension not to malloc/free
248-
memory across different libraries, avoid relying on changed data structures,
249-
and so on. Tools for generating extension modules usually avoid these things
250-
for you.
251-
252-
To set up a build environment for binary extensions, install
253-
`Visual Studio Community Edition <https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx>`__ - any
254-
recent version is fine.
255-
256-
One caveat: if you use Visual Studio 2019 or later, your extension will depend on an "extra"
257-
file, ``VCRUNTIME140_1.dll``, in addition to the ``VCRUNTIME140.dll`` that all previous
258-
verisions back to 2015 depend on. This will add an extra requirement to using
259-
your extension on versions of CPython that do not include this extra file. To
260-
avoid this, you can add the compile-time argument ``/d2FH4-``.
254+
Visual Studio are no longer available from Microsoft. If you do need to build
255+
for older versions, you can set ``DISTUTILS_USE_SDK=1`` and ``MSSdk=1`` to
256+
force a the currently activated version of MSVC to be found, and you should
257+
exercise care when designing your extension not to malloc/free memory across
258+
different libraries, avoid relying on changed data structures, and so on. Tools
259+
for generating extension modules usually avoid these things for you.
260+
261261

262262

263263
Binary extensions for Linux

0 commit comments

Comments
 (0)