Fix broken tests build in multi-binaries case.
When `WITH_TESTS_SINGLE_BINARY` is disabled, and `WITH_BUILDINFO` is enabled, (most of) the generated tests binaries need to link buildinfo. Pull Request: https://projects.blender.org/blender/blender/pulls/123734
This commit is contained in:
parent
0081c4b64a
commit
73db631440
@ -346,19 +346,23 @@ function(blender_add_test_suite_executable
|
|||||||
DISCOVER_TESTS FALSE
|
DISCOVER_TESTS FALSE
|
||||||
)
|
)
|
||||||
|
|
||||||
# Work-around run-time dynamic loader error
|
# Work-around run-time dynamic loader error
|
||||||
# symbol not found in flat namespace '_PyBaseObject_Type'
|
# symbol not found in flat namespace '_PyBaseObject_Type'
|
||||||
#
|
#
|
||||||
# Some tests are testing modules which are linked against Python, while some of unit
|
# Some tests are testing modules which are linked against Python, while some of unit
|
||||||
# tests might not use code path which uses Python functionality. In this case linker
|
# tests might not use code path which uses Python functionality. In this case linker
|
||||||
# will optimize out all symbols from Python since it decides they are not used. This
|
# will optimize out all symbols from Python since it decides they are not used. This
|
||||||
# somehow conflicts with other libraries which are linked against the test binary and
|
# somehow conflicts with other libraries which are linked against the test binary and
|
||||||
# perform search of _PyBaseObject_Type on startup.
|
# perform search of _PyBaseObject_Type on startup.
|
||||||
#
|
#
|
||||||
# Work-around by telling the linker that the python libraries should not be stripped.
|
# Work-around by telling the linker that the python libraries should not be stripped.
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
target_link_libraries("${_test_name}_test" PRIVATE "-Wl,-force_load,${PYTHON_LIBRARIES}")
|
target_link_libraries("${_test_name}_test" PRIVATE "-Wl,-force_load,${PYTHON_LIBRARIES}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_BUILDINFO)
|
||||||
|
target_link_libraries("${_test_name}_test" PRIVATE buildinfoobj)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user