macOS:cmake: build plugins directly to app bundle

Copying them afterwards ended up in the wrong order with Xcode's code signing, causing unsigned plugins to get copied, which would break the later step of signing the whole bundle
This commit is contained in:
TellowKrinkle 2020-09-11 22:58:43 -05:00 committed by tellowkrinkle
parent 2c8b2b48bd
commit 56b0026160
1 changed files with 2 additions and 5 deletions

View File

@ -130,11 +130,8 @@ macro(add_pcsx2_plugin lib srcs libs flags)
install(TARGETS ${lib} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)
if (APPLE)
# Copy to app bundle
add_custom_command(TARGET ${lib} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:PCSX2>/plugins"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${lib}>" "$<TARGET_FILE_DIR:PCSX2>/plugins/"
)
# Output to app bundle
set_target_properties(${lib} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:PCSX2>/plugins")
add_dependencies(pcsx2-postprocess-bundle ${lib})
endif()
endmacro(add_pcsx2_plugin)