From ef071b4cb308cf543afc5f397b995e5ca787920d Mon Sep 17 00:00:00 2001 From: Quentin Quadrat Date: Tue, 5 Nov 2024 00:10:33 +0100 Subject: [PATCH] CI: add MacOS target --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ addons/gdcef/build.py | 14 ++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddd67d1..1491460 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,49 @@ on: jobs: + ############################################################################# + ### MacOS + ############################################################################# + build_macos: + name: Build on MacOS + runs-on: macos-14 + steps: + - name: Checkout GDCEF + uses: actions/checkout@v3 + with: + ref: godot-4.x + submodules: true + - name: Install system packages + run: | + brew install ninja + - name: Install python packages + uses: getsentry/action-setup-venv@v2.1.0 + id: venv + with: + python-version: 3.10.7 + cache-dependency-path: addons/gdcef/requirements.txt + install-cmd: pip install -r addons/gdcef/requirements.txt + - name: Compile GDCEF + run: | + cd addons/gdcef + python3 build.py + - name: Check build + run: | + ls cef_artifacts/libgdcef.dylib + tar -czvf gdcef-artifacts-godot_4-macos_x86_64.tar.gz cef_artifacts + - name: Do release + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + uses: ncipollo/release-action@v1 + with: + artifacts: "gdcef-artifacts-godot_4-macos_x86_64.tar.gz" + ############################################################################# ### Linux ############################################################################# build_linux: name: Build on Linux runs-on: ubuntu-20.04 + needs: build_macos steps: - name: Checkout GDCEF uses: actions/checkout@v3 diff --git a/addons/gdcef/build.py b/addons/gdcef/build.py index c74c24a..ad08bf6 100755 --- a/addons/gdcef/build.py +++ b/addons/gdcef/build.py @@ -88,6 +88,7 @@ MODULE_TARGET = COMPILATION_MODE # "release" or "debug" # Use OpenMP for using CPU parallelism (i.e. for copying CEF textures to Godot) +# FIXME no openmp installed by default on MacOS :( CEF_USE_CPU_PARALLELISM = "yes" # or "no" # Minimun CMake version needed for compiling CEF @@ -133,6 +134,14 @@ def info(msg): print("\033[32m[INFO] " + msg + "\033[00m", flush=True) +############################################################################### +### +### Orange color message +### +############################################################################### +def warning(msg): + print("\033[33m[WARNING] " + msg + "\033[00m", flush=True) + ############################################################################### ### ### Red color message + abort @@ -558,6 +567,11 @@ def compile_godot_cpp(): ### ############################################################################### def gdnative_scons_cmd(platform): + # FIXME no openmp installed by default on MacOS :( + # https://gist.github.com/ijleesw/4f863543a50294e3ba54acf588a4a421 + if OSTYPE == "Darwin": + warning("Sorry for MacOS I have to disable openmp !!!") + CEF_USE_CPU_PARALLELISM="no" scons("api_path=" + GODOT_CPP_API_PATH, "cef_artifacts_folder=\\\"" + CEF_ARTIFACTS_FOLDER_NAME + "\\\"", "build_path=" + CEF_ARTIFACTS_BUILD_PATH,