mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-12 22:35:45 -04:00
Build: Add Mac dependencies and fix packaging
This commit is contained in:
@ -30,6 +30,7 @@
|
||||
#include <mach/mach_time.h>
|
||||
#include <mach/semaphore.h>
|
||||
#include <mach/task.h>
|
||||
#else
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
#endif
|
||||
@ -382,7 +383,7 @@ void* Threading::Thread::ThreadProc(void* param)
|
||||
|
||||
bool Threading::Thread::Start(EntryPoint func)
|
||||
{
|
||||
pxAssertRel(!m_native_handle, "Can't start an already-started thread");
|
||||
AssertMsg(!m_native_handle, "Can't start an already-started thread");
|
||||
|
||||
std::unique_ptr<EntryPoint> func_clone(std::make_unique<EntryPoint>(std::move(func)));
|
||||
|
||||
@ -550,6 +551,8 @@ void Threading::SetNameOfCurrentThread(const char* name)
|
||||
// Extract of manpage: "The name can be up to 16 bytes long, and should be
|
||||
// null-terminated if it contains fewer bytes."
|
||||
prctl(PR_SET_NAME, name, 0, 0, 0);
|
||||
#elif defined(__APPLE__)
|
||||
pthread_setname_np(name);
|
||||
#else
|
||||
pthread_set_name_np(pthread_self(), name);
|
||||
#endif
|
||||
|
@ -196,34 +196,31 @@ if(APPLE)
|
||||
MACOSX_BUNDLE true
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
|
||||
OUTPUT_NAME DuckStation
|
||||
)
|
||||
)
|
||||
|
||||
# Copy qt.conf into the bundle
|
||||
target_sources(duckstation-qt PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
|
||||
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
# Use macdeployqt to inject Qt into the bundle.
|
||||
get_target_property(MOC_EXECUTABLE_LOCATION Qt6::moc IMPORTED_LOCATION)
|
||||
get_filename_component(QT_BINARY_DIRECTORY "${MOC_EXECUTABLE_LOCATION}" DIRECTORY)
|
||||
find_program(MACDEPLOYQT_EXE macdeployqt HINTS "${QT_BINARY_DIRECTORY}")
|
||||
add_custom_target(duckstation-postprocess-bundle ALL
|
||||
COMMAND "${MACDEPLOYQT_EXE}" "${BUNDLE_PATH}"
|
||||
)
|
||||
add_dependencies(duckstation-postprocess-bundle duckstation-qt)
|
||||
|
||||
# Copy icon into the bundle
|
||||
target_sources(duckstation-qt PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns")
|
||||
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
|
||||
# Copy Qt plugins into the bundle
|
||||
get_target_property(qtcocoa_location Qt6::QCocoaIntegrationPlugin LOCATION)
|
||||
target_sources(duckstation-qt PRIVATE "${qtcocoa_location}")
|
||||
set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms)
|
||||
|
||||
get_target_property(qtmacstyle_location Qt6::QMacStylePlugin LOCATION)
|
||||
target_sources(duckstation-qt PRIVATE "${qtmacstyle_location}")
|
||||
set_source_files_properties("${qtmacstyle_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/styles)
|
||||
|
||||
# Copy resources into the bundle
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/data")
|
||||
file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/data" "${CMAKE_SOURCE_DIR}/data/*")
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/data/resources")
|
||||
file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/data/resources" "${CMAKE_SOURCE_DIR}/data/resources/*")
|
||||
foreach(res ${resources})
|
||||
target_sources(duckstation-qt PRIVATE "${CMAKE_SOURCE_DIR}/data/${res}")
|
||||
message(STATUS "Resource: ${res}")
|
||||
target_sources(duckstation-qt PRIVATE "${CMAKE_SOURCE_DIR}/data/resources/${res}")
|
||||
get_filename_component(resdir "${res}" DIRECTORY)
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/data/${res}" PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION "MacOS/${resdir}")
|
||||
source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/data/${res}")
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/data/resources/${res}" PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION "Resources/${resdir}")
|
||||
source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/data/resources/${res}")
|
||||
endforeach()
|
||||
|
||||
# Copy translations into the bundle
|
||||
@ -233,16 +230,17 @@ if(APPLE)
|
||||
COMMAND cp ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/translations/*.qm $<TARGET_FILE_DIR:duckstation-qt>/translations)
|
||||
|
||||
# Copy MoltenVK into the bundle
|
||||
target_sources(duckstation-qt PRIVATE "${CMAKE_SOURCE_DIR}/dep/mac/MoltenVK/libvulkan.dylib")
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/dep/mac/MoltenVK/libvulkan.dylib" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks)
|
||||
|
||||
# Update library references to make the bundle portable
|
||||
include(DolphinPostprocessBundle)
|
||||
dolphin_postprocess_bundle(duckstation-qt)
|
||||
# Fix rpath
|
||||
add_custom_command(TARGET duckstation-qt
|
||||
POST_BUILD COMMAND
|
||||
${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/"
|
||||
$<TARGET_FILE:duckstation-qt>)
|
||||
unset(MOLTENVK_PATH CACHE)
|
||||
find_file(MOLTENVK_PATH NAMES
|
||||
libMoltenVK.dylib
|
||||
lib/libMoltenVK.dylib
|
||||
)
|
||||
if (MOLTENVK_PATH)
|
||||
target_sources(duckstation-qt PRIVATE "${MOLTENVK_PATH}")
|
||||
set_source_files_properties("${MOLTENVK_PATH}" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks)
|
||||
message(STATUS "Using MoltenVK from ${MOLTENVK_PATH}")
|
||||
else()
|
||||
message(WARNING "MoltenVK not found in path, it will depend on the target system having it.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "util/ini_settings_interface.h"
|
||||
#include <atomic>
|
||||
#include <bitset>
|
||||
#include <unordered_map>
|
||||
#include <thread>
|
||||
Log_SetChannel(FullscreenUI);
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <array>
|
||||
#include <cctype>
|
||||
#include <ctime>
|
||||
#include <unordered_map>
|
||||
#include <string_view>
|
||||
#include <tinyxml2.h>
|
||||
#include <utility>
|
||||
|
Reference in New Issue
Block a user