Skip to content

Commit

Permalink
Fix custom post-build checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Osyotr committed Jul 27, 2022
1 parent 5216ebf commit 54b5f1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions ports/python3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,23 @@ else()

vcpkg_fixup_pkgconfig()

file(GLOB python_libs_dynload_release LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/lib-dynload/*_failed.so*")
file(GLOB python_libs_dynload_debug LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/debug/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/lib-dynload/*_failed.so*")
if(python_libs_dynload_release OR python_libs_dynload_debug)
message(FATAL_ERROR "There should be no modules with \"_failed\" suffix")
# Perform some post-build checks on modules
file(GLOB python_libs_dynload_debug LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/debug/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/lib-dynload/*.so*")
file(GLOB python_libs_dynload_release LIST_DIRECTORIES false "${CURRENT_PACKAGES_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/lib-dynload/*.so*")
set(python_libs_dynload_failed_debug ${python_libs_dynload_debug})
set(python_libs_dynload_failed_release ${python_libs_dynload_release})
list(FILTER python_libs_dynload_failed_debug INCLUDE REGEX ".*_failed\.so.*")
list(FILTER python_libs_dynload_failed_release INCLUDE REGEX ".*_failed\.so.*")
if(python_libs_dynload_failed_debug OR python_libs_dynload_failed_release)
list(JOIN python_libs_dynload_failed_debug "\n" python_libs_dynload_failed_debug_str)
list(JOIN python_libs_dynload_failed_release "\n" python_libs_dynload_failed_release_str)
message(FATAL_ERROR "There should be no modules with \"_failed\" suffix:\n${python_libs_dynload_failed_debug_str}\n${python_libs_dynload_failed_release_str}")
endif()
if(NOT VCPKG_BUILD_TYPE)
list(LENGTH python_libs_dynload_release python_libs_dynload_release_length)
list(LENGTH python_libs_dynload_debug python_libs_dynload_debug_length)
if(NOT python_libs_dynload_release_length STREQUAL python_libs_dynload_debug_length)
message(FATAL_ERROR "Mismatched number of modules: ${python_libs_dynload_release_length} in release, ${python_libs_dynload_debug_length} in debug")
message(FATAL_ERROR "Mismatched number of modules: ${python_libs_dynload_debug_length} in debug, ${python_libs_dynload_release_length} in release")
endif()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion versions/p-/python3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "d94c0b9b69694f1fd8e1ff82e21b69e78726a2d1",
"git-tree": "cedb85ba8b0fa2ea6717f1017f8eb6c087f2e8e5",
"version": "3.10.5",
"port-version": 2
},
Expand Down

0 comments on commit 54b5f1a

Please sign in to comment.