diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-09-15 19:10:44 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-09-15 19:27:01 +0300 |
commit | 5228b0b74fdb006c0ddb0f61bc1f6736f3fd7cb5 (patch) | |
tree | a1b0f75841ae0e26694f3828cf0b9b53540ef5e9 /build_files | |
parent | 335a6c0c87b805d2fe21a9d43294157b44fac28c (diff) |
Python: fix failing tests when building bpy module
* Use Python executable from lib folder since it's not installed.
* Make bpy module test work for portable install.
* Disable gtests which don't work with different Python link flags
and shared library locations.
Ref D15957
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/macros.cmake | 14 | ||||
-rw-r--r-- | build_files/cmake/platform/platform_win32.cmake | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index d271d8f216f..093106fc4dc 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -418,6 +418,13 @@ function(blender_add_test_lib library_deps ) + # Not currently supported for Python module due to different required + # Python link flags. + if(WITH_PYTHON_MODULE) + add_custom_target(${name}) + return() + endif() + add_cc_flags_custom_test(${name} PARENT_SCOPE) # Otherwise external projects will produce warnings that we cannot fix. @@ -464,6 +471,13 @@ function(blender_add_test_executable library_deps ) + # Not currently supported for Python module due to different required + # Python link flags. + if(WITH_PYTHON_MODULE) + add_custom_target(${name}) + return() + endif() + add_cc_flags_custom_test(${name} PARENT_SCOPE) ## Otherwise external projects will produce warnings that we cannot fix. diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index 66ab0d4169a..771b00a3d09 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -510,6 +510,8 @@ if(WITH_PYTHON) set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib) set(PYTHON_LIBRARY_DEBUG ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}_d.lib) + set(PYTHON_EXECUTABLE ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python$<$<CONFIG:Debug>:_d>.exe) + set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/include) set(PYTHON_NUMPY_INCLUDE_DIRS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/lib/site-packages/numpy/core/include) set(NUMPY_FOUND ON) |