Skip to content

Commit

Permalink
Merge pull request #1286 from fspindle/feat_ci_macos_13
Browse files Browse the repository at this point in the history
Introduce macos-13 an macos-13-arm64 runners
  • Loading branch information
fspindle authored Dec 4, 2023
2 parents e4338fe + f32af2c commit 270d95e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-12]
os: [macos-12, macos-13]

steps:
# https://github.com/marketplace/actions/cancel-workflow-action
Expand Down
72 changes: 42 additions & 30 deletions cmake/VISPUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,6 @@ macro(vp_get_interface_link_libraries libs link_libraries)
# message("fin __imported_libs: ${__imported_libs}")
# message("fin __libs: ${__libs}")


while(__imported_libs)
# message("begin while __imported_libs: ${__imported_libs}")
vp_list_pop_front(__imported_libs elt)
Expand All @@ -1421,39 +1420,52 @@ macro(vp_get_interface_link_libraries libs link_libraries)
foreach(config_ ${__config})
foreach(lib_ ${__libs})
# message("lib_: ${lib_}")
if(TARGET ${lib_})
get_target_property(imported_libs_ ${lib_} IMPORTED_IMPLIB_${config_})
if(NOT EXISTS ${imported_libs_})
get_target_property(lib_location_ ${lib_} IMPORTED_LOCATION_${config_})
endif()
# message("lib_location_: ${lib_location_}")
if(WIN32 AND EXISTS "${lib_location_}" AND "${config_}" MATCHES "RELEASE") # also valid for RELEASEWITHDEBINFO
list(APPEND ${link_libraries} optimized "${lib_location_}")
elseif(WIN32 AND EXISTS "${lib_location_}" AND "${config_}" MATCHES "DEBUG")
list(APPEND ${link_libraries} debug "${lib_location_}")
elseif(EXISTS ${lib_location_})
list(APPEND ${link_libraries} ${lib_location_})
endif()
if(TARGET ${lib_})

get_target_property(lib_deps_ ${lib_} IMPORTED_LINK_INTERFACE_LIBRARIES_${config_})
# message("lib_deps_ ---------: ${lib_deps_}")
if(lib_deps_)
foreach(deps_ ${lib_deps_})
get_target_property(deps_location_ ${deps_} IMPORTED_LOCATION_${config_})
if(EXISTS "${deps_location_}")
if(WIN32 AND "${config_}" MATCHES "RELEASE")
list(APPEND ${link_libraries} optimized ${deps_location_})
elseif(WIN32 AND "${config_}" MATCHES "DEBUG")
list(APPEND ${link_libraries} debug ${deps_location_})
else()
list(APPEND ${link_libraries} ${deps_location_})
get_target_property(imported_libs_ ${lib_} IMPORTED_IMPLIB_${config_})
if(NOT EXISTS ${imported_libs_})
get_target_property(lib_location_ ${lib_} IMPORTED_LOCATION_${config_})
endif()
# message("lib_location_: ${lib_location_}")
if(WIN32 AND EXISTS "${lib_location_}" AND "${config_}" MATCHES "RELEASE") # also valid for RELEASEWITHDEBINFO
list(APPEND ${link_libraries} optimized "${lib_location_}")
elseif(WIN32 AND EXISTS "${lib_location_}" AND "${config_}" MATCHES "DEBUG")
list(APPEND ${link_libraries} debug "${lib_location_}")
elseif(EXISTS ${lib_location_})
list(APPEND ${link_libraries} ${lib_location_})
endif()

get_target_property(lib_deps_ ${lib_} IMPORTED_LINK_INTERFACE_LIBRARIES_${config_})
# message("lib_deps_ ---------: ${lib_deps_}")
if(lib_deps_)
foreach(deps_ ${lib_deps_})
get_target_property(deps_location_ ${deps_} IMPORTED_LOCATION_${config_})
if(EXISTS "${deps_location_}")
if(WIN32 AND "${config_}" MATCHES "RELEASE")
list(APPEND ${link_libraries} optimized ${deps_location_})
elseif(WIN32 AND "${config_}" MATCHES "DEBUG")
list(APPEND ${link_libraries} debug ${deps_location_})
else()
list(APPEND ${link_libraries} ${deps_location_})
endif()
endif()
endforeach()
endif()
else()
# VTK_LIBRARIES does import /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libz.tbd
# that doesn't exist and that does lied to a link error when building ustk_gui module:
# No rule to make target `/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libz.tbd',
# needed by `lib/libvisp_ustk_gui.3.6.1.dylib'. Stop.
# Here we introduce an additional check to ensure that libraries suffixed by .tbd exist
if(${lib_} MATCHES "/([^/]+)\\.tbd$")
if(EXISTS ${lib_})
# Add only if .tbd file exists
list(APPEND ${link_libraries} ${lib_})
endif()
endforeach()
else()
list(APPEND ${link_libraries} ${lib_})
endif()
endif()
else()
list(APPEND ${link_libraries} ${lib_})
endif()

endforeach()
endforeach()
Expand Down

0 comments on commit 270d95e

Please sign in to comment.