Skip to content

Commit

Permalink
CI: add MacOS target
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Nov 5, 2024
1 parent a8bd96a commit ef071b4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions addons/gdcef/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ef071b4

Please sign in to comment.