comparison Sphinx/source/plugins/python.rst @ 377:ffe62e6c086f

Added a note about the debug libraries when building under Windows with Visual Studio.
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 06 Apr 2020 20:28:19 +0200
parents 766fe39fdf35
children c9fe3d0d0fa1
comparison
equal deleted inserted replaced
376:6d7a36447e21 377:ffe62e6c086f
159 your Python installation while invoking CMake. For instance:: 159 your Python installation while invoking CMake. For instance::
160 160
161 C:\orthanc-python\Build> cmake .. -DPYTHON_VERSION=2.7 -DPYTHON_WINDOWS_ROOT=C:/Python27 \ 161 C:\orthanc-python\Build> cmake .. -DPYTHON_VERSION=2.7 -DPYTHON_WINDOWS_ROOT=C:/Python27 \
162 -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 15 2017" 162 -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 15 2017"
163 163
164 **Note about debug builds**: usually, building Python modules such as the Python
165 plugin for Orthanc in debug mode (where ``_DEBUG`` is defined) leads to a module
166 (.exe or .dll) that requires a debug build of Python, and debug versions of all
167 the Python libraries. This is quite cumbersome, for it requires building Python
168 on your own or downloading additional debug files.
169
170 Since using a debug build of Python is only necessary in very specific cases
171 (such as the debugging of code at the boundary between Python and an extension),
172 we have changed the default behavior to use the release Python library by default.
173
174 This means that you are able to build this plugin in debug mode with the
175 standard Python distribution.
176
177 In case you need to use the Python debug libraries, you can instruct the build
178 system to do so by setting the ``PYTHON_WINDOWS_USE_RELEASE_LIBS`` CMake option,
179 that is ``ON`` by default, to ``OFF``. The previous build example would then be,
180 should you require a full debug build::
181
182 C:\orthanc-python\Build> cmake .. -DPYTHON_VERSION=2.7 -DPYTHON_WINDOWS_ROOT=C:/Python27 \
183 -DSTATIC_BUILD=ON -DPYTHON_WINDOWS_USE_RELEASE_LIBS=OFF \
184 -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 15 2017"
185
186 Please note that this CMake option only impacts **debug** builds under Windows,
187 when using (any version of) the Microsoft Visual Studio compiler.
164 188
165 Configuration options 189 Configuration options
166 --------------------- 190 ---------------------
167 191
168 The only two configuration options that are available for this plugin 192 The only two configuration options that are available for this plugin