diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-05-24 18:50:44 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-07-12 12:44:47 +0000 |
commit | 5337435edaa10518c4495d480f934e87b2ccd444 (patch) | |
tree | 9d4d876f0b9c163721dba1210de008045af6559f /sources/shiboken2 | |
parent | 8ae4d5827d1ccd463b99aaf54c2e8cb482094c91 (diff) |
Fix Windows module extensions and tests to work with --debug build
Use the same imp.get_suffixes() mechanism as on Unix, to determine
the suffix part of module extension files.
This fixes debug builds to work on Windows.
Note that the whole build stack has to use the same configuration,
no mixing is allowed on Windows.
For release build you need: python.exe + setup.py without --debug
flag + release build of Qt5.
For debug build you need: python_d.exe + setup.py with --debug
flag + debug build of Qt5.
Change-Id: I6188c859b5757d11e87d6a9e32b9ba558f7f609e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r-- | sources/shiboken2/CMakeLists.txt | 47 | ||||
-rw-r--r-- | sources/shiboken2/shibokenmodule/CMakeLists.txt | 3 |
2 files changed, 23 insertions, 27 deletions
diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt index 549974b8c..424142699 100644 --- a/sources/shiboken2/CMakeLists.txt +++ b/sources/shiboken2/CMakeLists.txt @@ -58,38 +58,37 @@ macro(get_python_extension_suffix) message("PYTHON_EXTENSION_SUFFIX: " ${PYTHON_EXTENSION_SUFFIX}) endmacro() -# Note the quirk that UNIX includes Apple! -if (UNIX) - if (NOT PYTHON_EXTENSION_SUFFIX) - get_python_extension_suffix() - endif() - if (NOT PYTHON_CONFIG_SUFFIX) - if (PYTHON_VERSION_MAJOR EQUAL 2) - set(PYTHON_CONFIG_SUFFIX "-python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") - if (PYTHON_EXTENSION_SUFFIX) - set(PYTHON_CONFIG_SUFFIX "${PYTHON_CONFIG_SUFFIX}${PYTHON_EXTENSION_SUFFIX}") - endif() - elseif (PYTHON_VERSION_MAJOR EQUAL 3) - set(PYTHON_CONFIG_SUFFIX "${PYTHON_EXTENSION_SUFFIX}") +if (NOT PYTHON_EXTENSION_SUFFIX) + get_python_extension_suffix() +endif() + +if (NOT PYTHON_CONFIG_SUFFIX) + if (PYTHON_VERSION_MAJOR EQUAL 2) + set(PYTHON_CONFIG_SUFFIX "-python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") + if (PYTHON_EXTENSION_SUFFIX) + set(PYTHON_CONFIG_SUFFIX "${PYTHON_CONFIG_SUFFIX}${PYTHON_EXTENSION_SUFFIX}") endif() + elseif (PYTHON_VERSION_MAJOR EQUAL 3) + set(PYTHON_CONFIG_SUFFIX "${PYTHON_EXTENSION_SUFFIX}") endif() +endif() - if (NOT PYTHON_SHARED_LIBRARY_SUFFIX) - set(PYTHON_SHARED_LIBRARY_SUFFIX "${PYTHON_CONFIG_SUFFIX}") +if (NOT PYTHON_SHARED_LIBRARY_SUFFIX) + set(PYTHON_SHARED_LIBRARY_SUFFIX "${PYTHON_CONFIG_SUFFIX}") - # Append a "v" to disambiguate the python version and the shiboken version in the - # shared library file name. - if (APPLE AND PYTHON_VERSION_MAJOR EQUAL 2) - set(PYTHON_SHARED_LIBRARY_SUFFIX "${PYTHON_SHARED_LIBRARY_SUFFIX}v") - endif() + # Append a "v" to disambiguate the python version and the shiboken version in the + # shared library file name. + if (APPLE AND PYTHON_VERSION_MAJOR EQUAL 2) + set(PYTHON_SHARED_LIBRARY_SUFFIX "${PYTHON_SHARED_LIBRARY_SUFFIX}v") endif() +endif() - message(STATUS "PYTHON_EXTENSION_SUFFIX: ${PYTHON_EXTENSION_SUFFIX}") - message(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}") - message(STATUS "PYTHON_SHARED_LIBRARY_SUFFIX: ${PYTHON_SHARED_LIBRARY_SUFFIX}") -endif() +message(STATUS "PYTHON_EXTENSION_SUFFIX: ${PYTHON_EXTENSION_SUFFIX}") +message(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}") +message(STATUS "PYTHON_SHARED_LIBRARY_SUFFIX: ${PYTHON_SHARED_LIBRARY_SUFFIX}") + if (NOT PYTHON_SITE_PACKAGES) execute_process( diff --git a/sources/shiboken2/shibokenmodule/CMakeLists.txt b/sources/shiboken2/shibokenmodule/CMakeLists.txt index 5e8e39d5f..31b98132d 100644 --- a/sources/shiboken2/shibokenmodule/CMakeLists.txt +++ b/sources/shiboken2/shibokenmodule/CMakeLists.txt @@ -27,9 +27,6 @@ set_property(TARGET shibokenmodule PROPERTY PREFIX "") set_property(TARGET shibokenmodule PROPERTY OUTPUT_NAME "shiboken2${PYTHON_EXTENSION_SUFFIX}") if(WIN32) - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set_property(TARGET shibokenmodule PROPERTY OUTPUT_NAME "shiboken2_d") - endif() set_property(TARGET shibokenmodule PROPERTY SUFFIX ".pyd") endif() target_link_libraries(shibokenmodule |