Build: Add Mac dependencies and fix packaging

This commit is contained in:
Connor McLaughlin
2022-07-31 14:46:30 +10:00
parent a899ca88f2
commit 0006c54c46
6 changed files with 204 additions and 67 deletions

View File

@ -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