From 5f659936707c747d3917ec5507af650a126a70ea Mon Sep 17 00:00:00 2001 From: Marek Wydmuch Date: Fri, 15 Dec 2023 23:18:35 +0100 Subject: [PATCH 1/2] Add support for viz_noxserver on macos --- src/lib/ViZDoomController.cpp | 6 +++--- src/lib/ViZDoomController.h | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/ViZDoomController.cpp b/src/lib/ViZDoomController.cpp index bb2a09bff..e5f2f0238 100644 --- a/src/lib/ViZDoomController.cpp +++ b/src/lib/ViZDoomController.cpp @@ -212,7 +212,7 @@ namespace vizdoom { this->MQDoom->send(MSG_CODE_CLOSE); - #ifdef OS_LINUX + #ifdef OS_POSIX if(0 == kill(this->doomProcessPid, 0)){ bpr::child doomProcess(this->doomProcessPid); bpr::terminate(doomProcess); @@ -1415,7 +1415,7 @@ namespace vizdoom { this->doomArgs.push_back("+viz_window_hidden"); this->doomArgs.push_back("1"); - #ifdef OS_LINUX + #ifdef OS_POSIX if (this->noXServer){ this->doomArgs.push_back("+viz_noxserver"); this->doomArgs.push_back("1"); @@ -1464,7 +1464,7 @@ namespace vizdoom { void DoomController::launchDoom() { try { bpr::child doomProcess = bpr::execute(bpri::set_args(this->doomArgs), bpri::inherit_env()); - #ifdef OS_LINUX + #ifdef OS_POSIX this->doomProcessPid = doomProcess.pid; #endif bpr::wait_for_exit(doomProcess); diff --git a/src/lib/ViZDoomController.h b/src/lib/ViZDoomController.h index 367dd9ae0..070e8912e 100644 --- a/src/lib/ViZDoomController.h +++ b/src/lib/ViZDoomController.h @@ -83,12 +83,16 @@ namespace vizdoom { /* OSes */ #ifdef __linux__ #define OS_LINUX + #define OS_POSIX #include #include #elif _WIN32 #define OS_WIN #elif __APPLE__ #define OS_OSX + #define OS_POSIX + #include + #include #endif class DoomController { @@ -329,7 +333,7 @@ namespace vizdoom { b::thread *doomThread; - #ifdef OS_LINUX + #ifdef OS_POSIX pid_t doomProcessPid; #endif From 7ebfb604f211137fcb076d70bf9484ae2e0fc90d Mon Sep 17 00:00:00 2001 From: Marek Wydmuch Date: Fri, 15 Dec 2023 23:37:09 +0100 Subject: [PATCH 2/2] Add name to the last step of build-wheels workflow --- .github/workflows/build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 9bd548be6..71eca72e0 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -70,6 +70,7 @@ jobs: path: dist/*.tar.gz upload_pypi: + name: Upload to PyPI needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: pypi