ci: add macOS build workflow (#114)

* ci: add macOS build workflow

* macos: add POSIX compatibility guards

* ci: select Xcode 26 for macOS

* macos: add kernel POSIX compatibility

* launcher: support macOS process startup

* ci: fix macOS architecture verification

* ci: cache glslang on Windows

---------

Co-authored-by: Abdullah K. <akjee204@gmail.com>
This commit is contained in:
nmzik
2026-07-27 22:01:50 +02:00
committed by GitHub
parent c71bb9fc9e
commit 8fe4765f9e
10 changed files with 150 additions and 19 deletions
+1
View File
@@ -40,6 +40,7 @@
#endif
#elif KYTY_PLATFORM == KYTY_PLATFORM_LINUX
#include <cerrno>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
+13 -1
View File
@@ -54,9 +54,21 @@ public:
m_handle = nullptr;
}
#elif KYTY_PLATFORM == KYTY_PLATFORM_LINUX
#if defined(__APPLE__)
{
char shm_name[64];
snprintf(shm_name, sizeof(shm_name), "/kyty-dm-%d-%llx", static_cast<int>(getpid()),
static_cast<unsigned long long>(reinterpret_cast<uintptr_t>(this)));
m_fd = shm_open(shm_name, O_RDWR | O_CREAT | O_EXCL, 0600);
if (m_fd >= 0) {
shm_unlink(shm_name);
}
}
#else
m_fd = static_cast<int>(syscall(SYS_memfd_create, "KytyDirectMemory", 0));
#endif
if (m_fd < 0) {
LOGF_COLOR(Log::Color::Red, "\t direct-memory backing: memfd_create failed: %d\n",
LOGF_COLOR(Log::Color::Red, "\t direct-memory backing: shared fd creation failed: %d\n",
errno);
return;
}
+7 -2
View File
@@ -1056,7 +1056,7 @@ static void PthreadAttrDbgPrint(const PthreadAttr* src) {
"\tstack_addr = 0x%016" PRIx64 "\n"
"\tstack_size = %" PRIu64 "\n",
mask, state, guard_size, inherit_sched, param.sched_priority, policy, solosched,
reinterpret_cast<uint64_t>(stack_addr), reinterpret_cast<uint64_t>(stack_size));
reinterpret_cast<uint64_t>(stack_addr), static_cast<uint64_t>(stack_size));
}
static constexpr int32_t DST_NONE = 0;
@@ -2640,7 +2640,12 @@ int KYTY_SYSV_ABI PthreadCondattrSetclock(PthreadCondattr* attr, KernelClockid c
return KERNEL_ERROR_EINVAL;
}
int result = pthread_condattr_setclock(&(*attr)->p, pclock_id);
#if defined(__APPLE__)
(void)pclock_id;
int result = 0;
#else
int result = pthread_condattr_setclock(&(*attr)->p, pclock_id);
#endif
(*attr)->clock_id = clock_id;
LOGF("\tcondattr setclock: clock_id = %d, native = %d, result = %d\n", clock_id,