Browse Source

Bug2799: mod-script-pipe fails to load on Mac...

... This broke at commit 938bbeb with changes in CMake scripts.

This can be fixed by invoking CopyLibs.cmake for modules too.

This affects only the macOS build.
pull/2/head
Paul Licameli 2 years ago
parent
commit
4a2fc192e6
  1. 9
      cmake-proxies/cmake-modules/AudacityFunctions.cmake
  2. 16
      cmake-proxies/cmake-modules/CopyLibs.cmake

9
cmake-proxies/cmake-modules/AudacityFunctions.cmake

@ -359,6 +359,15 @@ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
PREFIX ""
FOLDER "modules" # for IDE organization
)
if( CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" )
add_custom_command(
TARGET ${TARGET}
COMMAND ${CMAKE_COMMAND}
-D SRC="${_MODDIR}/${TARGET}.so"
-D WXWIN="${_SHARED_PROXY_BASE_PATH}/$<CONFIG>"
-P ${AUDACITY_MODULE_PATH}/CopyLibs.cmake
POST_BUILD )
endif()
else()
set( ATTRIBUTES "shape=octagon" )
set_target_property_all( ${TARGET} ${DIRECTORY_PROPERTY} "${_SHARED_PROXY_PATH}" )

16
cmake-proxies/cmake-modules/CopyLibs.cmake

@ -84,7 +84,13 @@ function( gather_libs src )
list( APPEND words "-change ${line} @executable_path/../Frameworks/${refname}" )
if( NOT "${lib}" IN_LIST VISITED )
if(
# Don't do depth first search from modules: assume the fixup
# of .dylib libraries was already done when this function
# was visited for the executable
NOT src MATCHES "\\.so$"
AND NOT "${lib}" IN_LIST VISITED
)
gather_libs( ${lib} )
endif()
endif()
@ -141,5 +147,9 @@ foreach( cmd ${postcmds} )
)
endforeach()
list( REMOVE_DUPLICATES libs )
file( INSTALL ${libs} DESTINATION ${DST} FOLLOW_SYMLINK_CHAIN )
# This .cmake file is invoked on Darwin for modules too.
# Do the INSTALL only for the executable.
if( NOT SRC MATCHES "\\.so$" )
list( REMOVE_DUPLICATES libs )
file( INSTALL ${libs} DESTINATION ${DST} FOLLOW_SYMLINK_CHAIN )
endif()
Loading…
Cancel
Save