From 2fa89fef85e3bffee29b2cdf2d67b1048183b7f1 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 19:01:48 +0100 Subject: [PATCH 01/44] Add python3 support --- download-deps.py | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/download-deps.py b/download-deps.py index ef0c2477659b..5967b58e6b4f 100755 --- a/download-deps.py +++ b/download-deps.py @@ -37,6 +37,7 @@ ****************************************************************************""" import os.path +from urllib.error import HTTPError import zipfile import shutil import sys @@ -95,7 +96,10 @@ def __init__(self, workpath, config_path, version_path, remote_version_key=None) self._url = data["repo_parent"] + self._repo_name + '/archive/' + self._filename self._zip_file_size = int(data["zip_file_size"]) # 'v' letter was swallowed by github, so we need to substring it from the 2nd letter - self._extracted_folder_name = os.path.join(self._workpath, self._repo_name + '-' + self._current_version[1:]) + if self._current_version[0] == 'v': + self._extracted_folder_name = os.path.join(self._workpath, self._repo_name + '-' + self._current_version[1:]) + else: + self._extracted_folder_name = os.path.join(self._workpath, self._repo_name + '-' + self._current_version) try: data = self.load_json_file(version_path) @@ -107,10 +111,10 @@ def __init__(self, workpath, config_path, version_path, remote_version_key=None) print("==> version file doesn't exist") def get_input_value(self, prompt): - if sys.version_info[0] > 2: - ret = input(prompt) - else: + if(python_2): ret = raw_input(prompt) + else: + ret = input(prompt) ret.rstrip(" \t") return ret @@ -121,18 +125,26 @@ def download_file(self): except OSError: pass print("==> Ready to download '%s' from '%s'" % (self._filename, self._url)) - import urllib2 + if(python_2): + import urllib2 as urllib + else: + import urllib.request as urllib try: - u = urllib2.urlopen(self._url) - except urllib2.HTTPError as e: + u = urllib.urlopen(self._url) + except Exception as e: if e.code == 404: print("==> Error: Could not find the file from url: '%s'" % (self._url)) - print("==> Http request failed, error code: " + str(e.code) + ", reason: " + e.read()) + print("==> Http request failed, error code: " + str(e.code) + ", reason: " + str(e.read())) sys.exit(1) f = open(self._filename, 'wb') meta = u.info() - content_len = meta.getheaders("Content-Length") + content_len = 0 + if(python_2): + content_len = meta.getheaders("Content-Length") + else: + content_len = meta['Content-Length'] + file_size = 0 if content_len and len(content_len) > 0: file_size = int(content_len[0]) @@ -246,7 +258,6 @@ def download_zip_file(self): self.download_zip_file() def download_file_with_retry(self, times, delay): - import urllib2 times_count = 0 while(times_count < times): times_count += 1 @@ -339,6 +350,14 @@ def run(self, workpath, folder_for_extracting, remove_downloaded, force_update, print("==> Download (%s) finish!" % self._filename) +def _is_python_version_2(): + major_ver = sys.version_info[0] + print ("The python version is %d.%d." % (major_ver, sys.version_info[1])) + if major_ver > 2: + return False + return True + + def main(): workpath = os.path.dirname(os.path.realpath(__file__)) @@ -365,6 +384,7 @@ def main(): # -------------- main -------------- if __name__ == '__main__': + python_2 = _is_python_version_2() try: main() except Exception as e: From 242f91d904b17e2c0a42376baf2b8ac94448c732 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 19:09:48 +0100 Subject: [PATCH 02/44] Update download-deps.py --- download-deps.py | 1 + 1 file changed, 1 insertion(+) diff --git a/download-deps.py b/download-deps.py index 5967b58e6b4f..119820f13e93 100755 --- a/download-deps.py +++ b/download-deps.py @@ -1,4 +1,5 @@ #!/usr/bin/env python + #coding=utf-8 # # ./download-deps.py From 0be91a8c70acd8587537c24ed28424d4f0608ce8 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 19:13:13 +0100 Subject: [PATCH 03/44] main.yml --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000000..a8471665a471 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the v4 branch + push: + branches: [ v4, v3 ] + pull_request: + branches: [ v4, v3 ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From 490e32cf5433d67e78cc5dc3b367492cc501a18e Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 19:20:06 +0100 Subject: [PATCH 04/44] download deps --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a8471665a471..c27437174762 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: # Runs a single command using the runners shell - name: Run a one-line script - run: echo Hello, world! + run: ./download-deps.py --r no # Runs a set of commands using the runners shell - name: Run a multi-line script From 97cf6b393e91b7b7f9841d896395863d933f7647 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 19:41:15 +0100 Subject: [PATCH 05/44] linux, windows --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c27437174762..97b754a11dea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" - build: + build_ubuntu: # The type of runner that the job will run on runs-on: ubuntu-latest @@ -26,11 +26,33 @@ jobs: - uses: actions/checkout@v2 # Runs a single command using the runners shell - - name: Run a one-line script + - name: download-deps.py run: ./download-deps.py --r no # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + - name: cmake setup + run: cmake -B b -S . + + - name: cmake build + run: cmake --build b + + # This workflow contains a single job called "build" + build_windows: + # The type of runner that the job will run on + runs-on: windows-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: download-deps.py + run: download-deps.py --r no + + # Runs a set of commands using the runners shell + - name: cmake setup + run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 + + - name: cmake build + run: cmake --build b \ No newline at end of file From f049c5e871624850ff992210208679d3e0829d21 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 19:50:46 +0100 Subject: [PATCH 06/44] python --- .github/workflows/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 97b754a11dea..297c4a168f88 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,10 @@ jobs: # Runs a single command using the runners shell - name: download-deps.py - run: ./download-deps.py --r no + python: download-deps.py --r no + + - name: install-deps-linux.sh + run: echo -e "y" | bash build/install-deps-linux.sh # Runs a set of commands using the runners shell - name: cmake setup @@ -48,7 +51,7 @@ jobs: # Runs a single command using the runners shell - name: download-deps.py - run: download-deps.py --r no + python: download-deps.py --r no # Runs a set of commands using the runners shell - name: cmake setup From 6ac9bcc1be35475395acab517be1f40445aaa807 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 19:54:59 +0100 Subject: [PATCH 07/44] python --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 297c4a168f88..3dbc5d78ac3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: # Runs a single command using the runners shell - name: download-deps.py - python: download-deps.py --r no + run: python download-deps.py --r no - name: install-deps-linux.sh run: echo -e "y" | bash build/install-deps-linux.sh @@ -51,7 +51,7 @@ jobs: # Runs a single command using the runners shell - name: download-deps.py - python: download-deps.py --r no + run: python download-deps.py --r no # Runs a set of commands using the runners shell - name: cmake setup From 22b4455c2898015f02fc63623bf3b94c7868d71b Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 20:00:02 +0100 Subject: [PATCH 08/44] Fix builds --- .github/workflows/main.yml | 2 +- build/install-deps-linux.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3dbc5d78ac3d..c522baba4078 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,7 +55,7 @@ jobs: # Runs a set of commands using the runners shell - name: cmake setup - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 + run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 - name: cmake build run: cmake --build b \ No newline at end of file diff --git a/build/install-deps-linux.sh b/build/install-deps-linux.sh index cf6bab4dae32..abf5fd29c3ff 100755 --- a/build/install-deps-linux.sh +++ b/build/install-deps-linux.sh @@ -17,7 +17,7 @@ DEPENDS+=' libglu1-mesa-dev' DEPENDS+=' libgl2ps-dev' DEPENDS+=' libxi-dev' DEPENDS+=' libzip-dev' -DEPENDS+=' libpng12-dev' +DEPENDS+=' libpng-dev' DEPENDS+=' libcurl4-gnutls-dev' DEPENDS+=' libfontconfig1-dev' DEPENDS+=' libsqlite3-dev' From c7beb3d278876e12a5f5c31b570351ac1de8732e Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 20:18:35 +0100 Subject: [PATCH 09/44] Add macos --- .github/workflows/main.yml | 68 +++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c522baba4078..eacdec67a527 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,9 +2,7 @@ name: CI -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the v4 branch push: branches: [ v4, v3 ] pull_request: @@ -13,49 +11,57 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build_ubuntu: - # The type of runner that the job will run on - runs-on: ubuntu-latest + # ubuntu-20.04: + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v2 + # - name: download-deps.py + # run: python download-deps.py --r no + # - name: install-deps-linux.sh + # run: echo -e "y" | bash build/install-deps-linux.sh + # - name: cmake setup + # run: cmake -B b -S . + # - name: cmake build + # run: cmake --build b - # Steps represent a sequence of tasks that will be executed as part of the job + windows-2019: + runs-on: windows-2019 steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - name: download-deps.py run: python download-deps.py --r no - - - name: install-deps-linux.sh - run: echo -e "y" | bash build/install-deps-linux.sh - - # Runs a set of commands using the runners shell - name: cmake setup - run: cmake -B b -S . - + run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 - name: cmake build run: cmake --build b - # This workflow contains a single job called "build" - build_windows: - # The type of runner that the job will run on - runs-on: windows-latest - - # Steps represent a sequence of tasks that will be executed as part of the job + windows-2022: + runs-on: windows-2022 steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - name: download-deps.py run: python download-deps.py --r no - - # Runs a set of commands using the runners shell - name: cmake setup - run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 + run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 + - name: cmake build + run: cmake --build b + macos-10.15: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - name: download-deps.py + run: python download-deps.py --r no + - name: cmake setup + run: cmake -B b -S . - name: cmake build - run: cmake --build b \ No newline at end of file + run: cmake --build b + + macos-10.15.2: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . + - run: cmake --build b \ No newline at end of file From 61cad35b31a021e615f7d06167a0038e8a202b22 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 20:20:13 +0100 Subject: [PATCH 10/44] Add macos --- .github/workflows/main.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eacdec67a527..dae0e15e40fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,18 +12,18 @@ on: workflow_dispatch: jobs: - # ubuntu-20.04: - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v2 - # - name: download-deps.py - # run: python download-deps.py --r no - # - name: install-deps-linux.sh - # run: echo -e "y" | bash build/install-deps-linux.sh - # - name: cmake setup - # run: cmake -B b -S . - # - name: cmake build - # run: cmake --build b + ubuntu-20_04: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: download-deps.py + run: python download-deps.py --r no + - name: install-deps-linux.sh + run: echo -e "y" | bash build/install-deps-linux.sh + - name: cmake setup + run: cmake -B b -S . + - name: cmake build + run: cmake --build b windows-2019: runs-on: windows-2019 @@ -47,7 +47,7 @@ jobs: - name: cmake build run: cmake --build b - macos-10.15: + macos-10_15: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 @@ -58,8 +58,8 @@ jobs: - name: cmake build run: cmake --build b - macos-10.15.2: - runs-on: macos-10.15 + macos-11: + runs-on: macos-11 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no From b2206c556eaa615d9b41226bffc3d2bdfc3e91ce Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 20:34:52 +0100 Subject: [PATCH 11/44] Fix linux --- .github/workflows/main.yml | 39 +++++++-------------- build/install-deps-linux.sh | 1 + download-deps.py | 67 +++++++++++++++++++++++-------------- 3 files changed, 56 insertions(+), 51 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dae0e15e40fe..cdbddd9cc59c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,47 +16,34 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: download-deps.py - run: python download-deps.py --r no - - name: install-deps-linux.sh - run: echo -e "y" | bash build/install-deps-linux.sh - - name: cmake setup - run: cmake -B b -S . - - name: cmake build - run: cmake --build b + - run: python download-deps.py --r no + - run: echo -e "y" | bash build/install-deps-linux.sh + - run: cmake -B b -S . + - run: cmake --build b windows-2019: runs-on: windows-2019 steps: - uses: actions/checkout@v2 - - name: download-deps.py - run: python download-deps.py --r no - - name: cmake setup - run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 - - name: cmake build - run: cmake --build b + - run: python download-deps.py --r no + - run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 + - run: cmake --build b windows-2022: runs-on: windows-2022 steps: - uses: actions/checkout@v2 - - name: download-deps.py - run: python download-deps.py --r no - - name: cmake setup - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 - - name: cmake build - run: cmake --build b + - run: python download-deps.py --r no + - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 + - run: cmake --build b macos-10_15: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 - - name: download-deps.py - run: python download-deps.py --r no - - name: cmake setup - run: cmake -B b -S . - - name: cmake build - run: cmake --build b + - run: python download-deps.py --r no + - run: cmake -B b -S . + - run: cmake --build b macos-11: runs-on: macos-11 diff --git a/build/install-deps-linux.sh b/build/install-deps-linux.sh index abf5fd29c3ff..eb86ba7ae986 100755 --- a/build/install-deps-linux.sh +++ b/build/install-deps-linux.sh @@ -25,5 +25,6 @@ DEPENDS+=' libglew-dev' DEPENDS+=' libssl-dev' DEPENDS+=' libgtk-3-dev' DEPENDS+=' binutils' +DEPENDS+=' xorg-dev' sudo apt-get install --force-yes --yes $DEPENDS > /dev/null diff --git a/download-deps.py b/download-deps.py index 119820f13e93..07afedb174b9 100755 --- a/download-deps.py +++ b/download-deps.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -#coding=utf-8 +# coding=utf-8 # # ./download-deps.py # @@ -38,20 +38,17 @@ ****************************************************************************""" import os.path -from urllib.error import HTTPError import zipfile import shutil import sys import traceback import distutils -import fileinput import json from optparse import OptionParser from time import time from time import sleep from sys import stdout -from distutils.errors import DistutilsError from distutils.dir_util import copy_tree, remove_tree @@ -94,13 +91,16 @@ def __init__(self, workpath, config_path, version_path, remote_version_key=None) except: self._move_dirs = None self._filename = self._current_version + '.zip' - self._url = data["repo_parent"] + self._repo_name + '/archive/' + self._filename + self._url = data["repo_parent"] + \ + self._repo_name + '/archive/' + self._filename self._zip_file_size = int(data["zip_file_size"]) # 'v' letter was swallowed by github, so we need to substring it from the 2nd letter if self._current_version[0] == 'v': - self._extracted_folder_name = os.path.join(self._workpath, self._repo_name + '-' + self._current_version[1:]) + self._extracted_folder_name = os.path.join( + self._workpath, self._repo_name + '-' + self._current_version[1:]) else: - self._extracted_folder_name = os.path.join(self._workpath, self._repo_name + '-' + self._current_version) + self._extracted_folder_name = os.path.join( + self._workpath, self._repo_name + '-' + self._current_version) try: data = self.load_json_file(version_path) @@ -125,7 +125,8 @@ def download_file(self): os.remove(self._filename) except OSError: pass - print("==> Ready to download '%s' from '%s'" % (self._filename, self._url)) + print("==> Ready to download '%s' from '%s'" % + (self._filename, self._url)) if(python_2): import urllib2 as urllib else: @@ -134,8 +135,10 @@ def download_file(self): u = urllib.urlopen(self._url) except Exception as e: if e.code == 404: - print("==> Error: Could not find the file from url: '%s'" % (self._url)) - print("==> Http request failed, error code: " + str(e.code) + ", reason: " + str(e.read())) + print("==> Error: Could not find the file from url: '%s'" % + (self._url)) + print("==> Http request failed, error code: " + + str(e.code) + ", reason: " + str(e.read())) sys.exit(1) f = open(self._filename, 'wb') @@ -153,7 +156,8 @@ def download_file(self): # github server may not reponse a header information which contains `Content-Length`, # therefore, the size needs to be written hardcode here. While server doesn't return # `Content-Length`, use it instead - print("==> WARNING: Couldn't grab the file size from remote, use 'zip_file_size' section in '%s'" % self._config_path) + print("==> WARNING: Couldn't grab the file size from remote, use 'zip_file_size' section in '%s'" % + self._config_path) file_size = self._zip_file_size print("==> Start to download, please wait ...") @@ -178,9 +182,11 @@ def download_file(self): speed = block_size_per_second / (new_time - old_time) / 1000.0 if file_size != 0: percent = file_size_dl * 100. / file_size - status = r"Downloaded: %6dK / Total: %dK, Percent: %3.2f%%, Speed: %6.2f KB/S " % (file_size_dl / 1000, file_size / 1000, percent, speed) + status = r"Downloaded: %6dK / Total: %dK, Percent: %3.2f%%, Speed: %6.2f KB/S " % ( + file_size_dl / 1000, file_size / 1000, percent, speed) else: - status = r"Downloaded: %6dK, Speed: %6.2f KB/S " % (file_size_dl / 1000, speed) + status = r"Downloaded: %6dK, Speed: %6.2f KB/S " % ( + file_size_dl / 1000, speed) print(status), sys.stdout.flush() print("\r"), @@ -237,7 +243,8 @@ def unpack_zipfile(self, extract_dir): print("==> Extraction done!") def ask_to_delete_downloaded_zip_file(self): - ret = self.get_input_value("==> Would you like to save '%s'? So you don't have to download it later. [Yes/no]: " % self._filename) + ret = self.get_input_value( + "==> Would you like to save '%s'? So you don't have to download it later. [Yes/no]: " % self._filename) ret = ret.strip() if ret != 'yes' and ret != 'y' and ret != 'no' and ret != 'n': print("==> Saving the dependency libraries by default") @@ -250,9 +257,11 @@ def download_zip_file(self): self.download_file_with_retry(5, 3) try: if not zipfile.is_zipfile(self._filename): - raise UnrecognizedFormat("%s is not a zip file" % (self._filename)) + raise UnrecognizedFormat( + "%s is not a zip file" % (self._filename)) except UnrecognizedFormat as e: - print("==> Unrecognized zip format from your local '%s' file!" % (self._filename)) + print("==> Unrecognized zip format from your local '%s' file!" % + (self._filename)) if os.path.isfile(self._filename): os.remove(self._filename) print("==> Download it from internet again, please wait...") @@ -302,15 +311,17 @@ def fix_fmod_link(self, extract_dir): import platform if platform.system() != "Linux": return - print("==> Fix fmod link ... ") - fmod_path = os.path.join(extract_dir, "linux-specific/fmod/prebuilt/64-bit") + print("==> Fix fmod link ... ") + fmod_path = os.path.join( + extract_dir, "linux-specific/fmod/prebuilt/64-bit") if os.path.exists(fmod_path): os.unlink(os.path.join(fmod_path, "libfmod.so.6")) os.unlink(os.path.join(fmod_path, "libfmodL.so.6")) os.symlink("libfmod.so", os.path.join(fmod_path, "libfmod.so.6")) os.symlink("libfmodL.so", os.path.join(fmod_path, "libfmodL.so.6")) else: - print("==> fmod directory not found `%s`, failed to fix fmod link!"%fmod_path) + print( + "==> fmod directory not found `%s`, failed to fix fmod link!" % fmod_path) def run(self, workpath, folder_for_extracting, remove_downloaded, force_update, download_only): if not force_update and not self.need_to_update(): @@ -330,13 +341,16 @@ def run(self, workpath, folder_for_extracting, remove_downloaded, force_update, self.clean_external_folder(folder_for_extracting) print("==> Copying files...") - distutils.dir_util.copy_tree(self._extracted_folder_name, folder_for_extracting) + distutils.dir_util.copy_tree( + self._extracted_folder_name, folder_for_extracting) if self._move_dirs is not None: for srcDir in self._move_dirs.keys(): - distDir = os.path.join( os.path.join(workpath, self._move_dirs[srcDir]), srcDir) + distDir = os.path.join(os.path.join( + workpath, self._move_dirs[srcDir]), srcDir) if os.path.exists(distDir): shutil.rmtree(distDir) - shutil.move( os.path.join(folder_for_extracting, srcDir), distDir) + shutil.move(os.path.join( + folder_for_extracting, srcDir), distDir) self.fix_fmod_link(folder_for_extracting) print("==> Cleaning...") if os.path.exists(self._extracted_folder_name): @@ -353,7 +367,7 @@ def run(self, workpath, folder_for_extracting, remove_downloaded, force_update, def _is_python_version_2(): major_ver = sys.version_info[0] - print ("The python version is %d.%d." % (major_ver, sys.version_info[1])) + print("The python version is %d.%d." % (major_ver, sys.version_info[1])) if major_ver > 2: return False return True @@ -380,8 +394,11 @@ def main(): print("=======================================================") print("==> Prepare to download external libraries!") external_path = os.path.join(workpath, 'external') - installer = CocosZipInstaller(workpath, os.path.join(workpath, 'external', 'config.json'), os.path.join(workpath, 'external', 'version.json'), "prebuilt_libs_version") - installer.run(workpath, external_path, opts.remove_downloaded, opts.force_update, opts.download_only) + installer = CocosZipInstaller(workpath, os.path.join(workpath, 'external', 'config.json'), os.path.join( + workpath, 'external', 'version.json'), "prebuilt_libs_version") + installer.run(workpath, external_path, opts.remove_downloaded, + opts.force_update, opts.download_only) + # -------------- main -------------- if __name__ == '__main__': From 4b874ccb394be4741836009005537f39dd6900bd Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 20:51:47 +0100 Subject: [PATCH 12/44] ios, android --- .github/workflows/main.yml | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cdbddd9cc59c..679779d10d2a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,4 +51,38 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . - - run: cmake --build b \ No newline at end of file + - run: cmake --build b + + macos-10_15_ios: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . -DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -GXcode -DIOS_PLATFORM=SIMULATOR64 + - run: cmake --build b + + macos-11_ios: + runs-on: macos-11 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . -DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -GXcode -DIOS_PLATFORM=SIMULATOR64 + - run: cmake --build b + + windows-2019-android: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info + shell: bash + working-directory: tests/cpp-tests/proj.android + + ubuntu-20_04-android: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info + shell: bash + working-directory: tests/cpp-tests/proj.android \ No newline at end of file From 6b3cc2e7b047189f4773d2370078a822f0363123 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 20:59:15 +0100 Subject: [PATCH 13/44] Fix ios --- cmake/Modules/CocosBuildHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/CocosBuildHelpers.cmake b/cmake/Modules/CocosBuildHelpers.cmake index f88058e3626b..f9d46060b682 100644 --- a/cmake/Modules/CocosBuildHelpers.cmake +++ b/cmake/Modules/CocosBuildHelpers.cmake @@ -269,7 +269,7 @@ endmacro() # custom Xcode property for iOS target macro(cocos_config_target_xcode_property cocos_target) if(IOS) - set_xcode_property(${cocos_target} IPHONEOS_DEPLOYMENT_TARGET "8.0") + set_xcode_property(${cocos_target} IPHONEOS_DEPLOYMENT_TARGET "9.0") set_xcode_property(${cocos_target} ENABLE_BITCODE "NO") set_xcode_property(${cocos_target} ONLY_ACTIVE_ARCH "YES") endif() From 80cdde8e41e8e66904aebd8809ae9720b3013778 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 22:09:41 +0100 Subject: [PATCH 14/44] ubuntu 18,4 --- .github/workflows/main.yml | 109 ++++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 50 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 679779d10d2a..93fb342e7d94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,8 +12,8 @@ on: workflow_dispatch: jobs: - ubuntu-20_04: - runs-on: ubuntu-20.04 + ubuntu-18_04: + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no @@ -21,68 +21,77 @@ jobs: - run: cmake -B b -S . - run: cmake --build b - windows-2019: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 - - run: cmake --build b + # ubuntu-20_04: + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: echo -e "y" | bash build/install-deps-linux.sh + # - run: cmake -B b -S . + # - run: cmake --build b - windows-2022: - runs-on: windows-2022 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 - - run: cmake --build b + # windows-2019: + # runs-on: windows-2019 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 + # - run: cmake --build b - macos-10_15: - runs-on: macos-10.15 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . - - run: cmake --build b + # windows-2022: + # runs-on: windows-2022 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 + # - run: cmake --build b - macos-11: - runs-on: macos-11 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . - - run: cmake --build b + # macos-10_15: + # runs-on: macos-10.15 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: cmake -B b -S . + # - run: cmake --build b + + # macos-11: + # runs-on: macos-11 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: cmake -B b -S . + # - run: cmake --build b macos-10_15_ios: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -GXcode -DIOS_PLATFORM=SIMULATOR64 - - run: cmake --build b + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake --build b --config Release -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" macos-11_ios: runs-on: macos-11 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -DCMAKE_TOOLCHAIN_FILE=cmake/ios.toolchain.cmake -GXcode -DIOS_PLATFORM=SIMULATOR64 - - run: cmake --build b + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake --build b --config Release -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" - windows-2019-android: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info - shell: bash - working-directory: tests/cpp-tests/proj.android + # windows-2019-android: + # runs-on: windows-2019 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info + # shell: bash + # working-directory: tests/cpp-tests/proj.android - ubuntu-20_04-android: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info - shell: bash - working-directory: tests/cpp-tests/proj.android \ No newline at end of file + # ubuntu-20_04-android: + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info + # shell: bash + # working-directory: tests/cpp-tests/proj.android \ No newline at end of file From b9ded51f468355cfee2f2fc86fe4d7b587edf214 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 22:17:30 +0100 Subject: [PATCH 15/44] Fix ios platform cmake --- cmake/Modules/CocosConfigDefine.cmake | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cmake/Modules/CocosConfigDefine.cmake b/cmake/Modules/CocosConfigDefine.cmake index 024ed3be5158..bc7b41a8239c 100644 --- a/cmake/Modules/CocosConfigDefine.cmake +++ b/cmake/Modules/CocosConfigDefine.cmake @@ -17,14 +17,13 @@ set(PLATFORM_FOLDER linux) endif() elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - if(IOS) - set(APPLE TRUE) - set(PLATFORM_FOLDER ios) - else() - set(APPLE TRUE) - set(MACOSX TRUE) - set(PLATFORM_FOLDER mac) - endif() + set(APPLE TRUE) + set(MACOSX TRUE) + set(PLATFORM_FOLDER mac) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS") + set(APPLE TRUE) + set(IOS TRUE) + set(PLATFORM_FOLDER ios) else() message(FATAL_ERROR "Unsupported platform, CMake will exit") return() From 9dafbccb9cb4855db87909d22cc59acfba3586fa Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 22:24:23 +0100 Subject: [PATCH 16/44] cpp-tests only --- .github/workflows/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93fb342e7d94..c8b3b01691ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,14 +12,14 @@ on: workflow_dispatch: jobs: - ubuntu-18_04: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: echo -e "y" | bash build/install-deps-linux.sh - - run: cmake -B b -S . - - run: cmake --build b + # ubuntu-18_04: + # runs-on: ubuntu-18.04 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: echo -e "y" | bash build/install-deps-linux.sh + # - run: cmake -B b -S . + # - run: cmake --build b # ubuntu-20_04: # runs-on: ubuntu-20.04 @@ -68,7 +68,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - - run: cmake --build b --config Release -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + - run: cmake --build b --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" macos-11_ios: runs-on: macos-11 @@ -76,7 +76,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - - run: cmake --build b --config Release -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + - run: cmake --build b --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" # windows-2019-android: # runs-on: windows-2019 From a522ac55aceb5f6d9a5b4ede0dfdaf2e7029b12a Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 22:32:41 +0100 Subject: [PATCH 17/44] --parallel --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8b3b01691ec..6e9042e7e998 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - - run: cmake --build b --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" macos-11_ios: runs-on: macos-11 @@ -76,7 +76,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - - run: cmake --build b --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" # windows-2019-android: # runs-on: windows-2019 From ed8aeb14a8998349795487d6643bbc8c2b35e540 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 22:36:23 +0100 Subject: [PATCH 18/44] linux parallel --- .github/workflows/main.yml | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e9042e7e998..04bb64e8ef87 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,14 +12,14 @@ on: workflow_dispatch: jobs: - # ubuntu-18_04: - # runs-on: ubuntu-18.04 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: echo -e "y" | bash build/install-deps-linux.sh - # - run: cmake -B b -S . - # - run: cmake --build b + ubuntu-18_04: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: echo -e "y" | bash build/install-deps-linux.sh + - run: cmake -B b -S . + - run: cmake --build b --parallel # ubuntu-20_04: # runs-on: ubuntu-20.04 @@ -62,21 +62,21 @@ jobs: # - run: cmake -B b -S . # - run: cmake --build b - macos-10_15_ios: - runs-on: macos-10.15 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + # macos-10_15_ios: + # runs-on: macos-10.15 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + # - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" - macos-11_ios: - runs-on: macos-11 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + # macos-11_ios: + # runs-on: macos-11 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + # - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" # windows-2019-android: # runs-on: windows-2019 From fdc740c672b2e1d674404925916fc9b575ca7cc3 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 23:10:07 +0100 Subject: [PATCH 19/44] remove linux parallel --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04bb64e8ef87..328d12a3e71d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - run: python download-deps.py --r no - run: echo -e "y" | bash build/install-deps-linux.sh - run: cmake -B b -S . - - run: cmake --build b --parallel + - run: cmake --build b # ubuntu-20_04: # runs-on: ubuntu-20.04 From 1f851bd0d338e8928586e862ed893dbd325c1a9c Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 23:21:34 +0100 Subject: [PATCH 20/44] ios: --- .github/workflows/main.yml | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 328d12a3e71d..ec3e4b99d5a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,14 +12,14 @@ on: workflow_dispatch: jobs: - ubuntu-18_04: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: echo -e "y" | bash build/install-deps-linux.sh - - run: cmake -B b -S . - - run: cmake --build b + # ubuntu-18_04: + # runs-on: ubuntu-18.04 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: echo -e "y" | bash build/install-deps-linux.sh + # - run: cmake -B b -S . + # - run: cmake --build b # ubuntu-20_04: # runs-on: ubuntu-20.04 @@ -62,21 +62,21 @@ jobs: # - run: cmake -B b -S . # - run: cmake --build b - # macos-10_15_ios: - # runs-on: macos-10.15 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - # - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + macos-10_15_ios: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS + - run: cmake --build b --parallel --config Release --target cpp-tests - # macos-11_ios: - # runs-on: macos-11 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - # - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + macos-11_ios: + runs-on: macos-11 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS + - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" # windows-2019-android: # runs-on: windows-2019 From a18de896232b004976063373ba226f8c80d7bcc6 Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 23:23:21 +0100 Subject: [PATCH 21/44] quiet --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec3e4b99d5a2..7bc9e6e91f39 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS - - run: cmake --build b --parallel --config Release --target cpp-tests + - run: cmake --build b --parallel --config Release --target cpp-tests -- -quiet macos-11_ios: runs-on: macos-11 @@ -76,7 +76,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS - - run: cmake --build b --parallel --config Release --target cpp-tests -- -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + - run: cmake --build b --parallel --config Release --target cpp-tests -- -quiet -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" # windows-2019-android: # runs-on: windows-2019 From 6393bc2274ca116b87ff0fda1b95f8391289c08a Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 23:29:01 +0100 Subject: [PATCH 22/44] Enable all --- .github/workflows/main.yml | 128 ++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7bc9e6e91f39..f464c0f5209e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,86 +12,86 @@ on: workflow_dispatch: jobs: - # ubuntu-18_04: - # runs-on: ubuntu-18.04 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: echo -e "y" | bash build/install-deps-linux.sh - # - run: cmake -B b -S . - # - run: cmake --build b + ubuntu-18_04: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: echo -e "y" | bash build/install-deps-linux.sh + - run: cmake -B b -S . + - run: cmake --build b - # ubuntu-20_04: - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: echo -e "y" | bash build/install-deps-linux.sh - # - run: cmake -B b -S . - # - run: cmake --build b + ubuntu-20_04: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: echo -e "y" | bash build/install-deps-linux.sh + - run: cmake -B b -S . + - run: cmake --build b - # windows-2019: - # runs-on: windows-2019 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 - # - run: cmake --build b + windows-2019: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . -G "Visual Studio 16 2019" -A Win32 + - run: cmake --build b - # windows-2022: - # runs-on: windows-2022 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 - # - run: cmake --build b + windows-2022: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 + - run: cmake --build b - # macos-10_15: - # runs-on: macos-10.15 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: cmake -B b -S . - # - run: cmake --build b + macos-10_15: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . + - run: cmake --build b - # macos-11: - # runs-on: macos-11 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: cmake -B b -S . - # - run: cmake --build b + macos-11: + runs-on: macos-11 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . + - run: cmake --build b macos-10_15_ios: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS - - run: cmake --build b --parallel --config Release --target cpp-tests -- -quiet + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake --build b --config Release --target cpp-tests -- -quiet macos-11_ios: runs-on: macos-11 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS - - run: cmake --build b --parallel --config Release --target cpp-tests -- -quiet -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake --build b --config Release --target cpp-tests -- -quiet -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" - # windows-2019-android: - # runs-on: windows-2019 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info - # shell: bash - # working-directory: tests/cpp-tests/proj.android + windows-2019-android: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info + shell: bash + working-directory: tests/cpp-tests/proj.android - # ubuntu-20_04-android: - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v2 - # - run: python download-deps.py --r no - # - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --parallel --info - # shell: bash - # working-directory: tests/cpp-tests/proj.android \ No newline at end of file + ubuntu-20_04-android: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info + shell: bash + working-directory: tests/cpp-tests/proj.android \ No newline at end of file From d56ac70e171092e18f5dec3039e873e9824dbfba Mon Sep 17 00:00:00 2001 From: CHP Date: Wed, 1 Dec 2021 23:29:25 +0100 Subject: [PATCH 23/44] a --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f464c0f5209e..d1f76e5e2640 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,7 +67,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - run: cmake --build b --config Release --target cpp-tests -- -quiet macos-11_ios: @@ -75,7 +75,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - run: cmake --build b --config Release --target cpp-tests -- -quiet -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" windows-2019-android: From d9887462ee9cd4b3477433b88237df37c066630a Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 07:18:14 +0100 Subject: [PATCH 24/44] arm64 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1f76e5e2640..f7fa395fc5fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,7 +67,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=arm64 - run: cmake --build b --config Release --target cpp-tests -- -quiet macos-11_ios: @@ -75,7 +75,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=arm64 - run: cmake --build b --config Release --target cpp-tests -- -quiet -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" windows-2019-android: From 6e92cb445a802db41e042f8ec6542f23ea81a531 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 08:01:32 +0100 Subject: [PATCH 25/44] ios --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7fa395fc5fa..d1f76e5e2640 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,7 +67,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=arm64 + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - run: cmake --build b --config Release --target cpp-tests -- -quiet macos-11_ios: @@ -75,7 +75,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=arm64 + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator - run: cmake --build b --config Release --target cpp-tests -- -quiet -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" windows-2019-android: From 38d1ebd77c973068cdfd7ad042a2723385090a05 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 09:30:11 +0100 Subject: [PATCH 26/44] new line --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1f76e5e2640..d1d1f80ab020 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,4 +94,4 @@ jobs: - run: python download-deps.py --r no - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info shell: bash - working-directory: tests/cpp-tests/proj.android \ No newline at end of file + working-directory: tests/cpp-tests/proj.android From db8061ce62833287a37af39c6ebcaceb206fcc92 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 10:45:37 +0100 Subject: [PATCH 27/44] Update CDAudioManager.m --- cocos/audio/mac/CDAudioManager.m | 37 ++++++++------------------------ 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/cocos/audio/mac/CDAudioManager.m b/cocos/audio/mac/CDAudioManager.m index ced152e4e915..57a99456d45b 100644 --- a/cocos/audio/mac/CDAudioManager.m +++ b/cocos/audio/mac/CDAudioManager.m @@ -325,8 +325,9 @@ + (void) configure: (tAudioManagerMode) mode { -(BOOL) isOtherAudioPlaying { UInt32 isPlaying = 0; - UInt32 varSize = sizeof(isPlaying); - AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying, &varSize, &isPlaying); + //UInt32 varSize = sizeof(isPlaying); + //AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying, &varSize, &isPlaying); + isPlaying = [[AVAudioSession sharedInstance] isOtherAudioPlaying]; return (isPlaying != 0); } @@ -405,9 +406,9 @@ - (id) init: (tAudioManagerMode) mode { if ((self = [super init])) { //Initialise the audio session - AVAudioSession* session = [AVAudioSession sharedInstance]; - session.delegate = self; - + //AVAudioSession* session = [AVAudioSession sharedInstance]; + //session.delegate = self; + [[AVAudioSession sharedInstance] setActive:YES error:nil]; _mode = mode; backgroundMusicCompletionSelector = nil; _isObservingAppEvents = FALSE; @@ -474,33 +475,13 @@ -(BOOL) isBackgroundMusicPlaying { //however, on a 3gs running 3.1.2 no route change is generated when the user switches the //ringer mute switch to off (i.e. enables sound) therefore polling is the only reliable way to //determine ringer switch state --(BOOL) isDeviceMuted { + -(BOOL) isDeviceMuted { #if TARGET_IPHONE_SIMULATOR //Calling audio route stuff on the simulator causes problems return NO; -#else - CFStringRef newAudioRoute; - UInt32 propertySize = sizeof (CFStringRef); - - AudioSessionGetProperty ( - kAudioSessionProperty_AudioRoute, - &propertySize, - &newAudioRoute - ); - - if (newAudioRoute == NULL) { - //Don't expect this to happen but playing safe otherwise a null in the CFStringCompare will cause a crash - return YES; - } else { - CFComparisonResult newDeviceIsMuted = CFStringCompare ( - newAudioRoute, - (CFStringRef) @"", - 0 - ); - - return (newDeviceIsMuted == kCFCompareEqualTo); - } +#else + return NO; #endif } From a59bfabbe63c30c2e92ca10940652ec39be2d3d3 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 10:48:51 +0100 Subject: [PATCH 28/44] Update CDXMacOSXSupport.h --- cocos/audio/mac/CDXMacOSXSupport.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/audio/mac/CDXMacOSXSupport.h b/cocos/audio/mac/CDXMacOSXSupport.h index eaa97f2e3465..7aad68cced26 100644 --- a/cocos/audio/mac/CDXMacOSXSupport.h +++ b/cocos/audio/mac/CDXMacOSXSupport.h @@ -40,10 +40,10 @@ #import #import -enum AudioSessionProperties { - kAudioSessionProperty_OtherAudioIsPlaying, - kAudioSessionProperty_AudioRoute -}; +// enum AudioSessionProperties { +// kAudioSessionProperty_OtherAudioIsPlaying, +// kAudioSessionProperty_AudioRoute +// }; #ifdef __cplusplus extern "C" { #endif From 7925a6ee0d00e1901146d5dfc9653f75c47314fd Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 14:13:43 +0100 Subject: [PATCH 29/44] cmake pch --- cocos/CMakeLists.txt | 11 ++++------- cocos/scripting/js-bindings/CMakeLists.txt | 9 ++++----- tests/cpp-tests/CMakeLists.txt | 9 ++++----- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 4939800375a9..410a24e03034 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -162,11 +162,8 @@ if(XCODE OR VS) cocos_mark_code_files("cocos2d") endif() -if(WINDOWS) - # precompiled header. Compilation time speedup ~4x. - target_sources(cocos2d PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp") - set_target_properties(cocos2d PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h") - set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h") - # compile c as c++. needed for precompiled header - set_source_files_properties(${COCOS_SPINE_SRC} base/ccFPSImages.c PROPERTIES LANGUAGE CXX) +if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") + message("CMake 3.16 target_precompile_headers") + target_precompile_headers(cocos2d PRIVATE + "$<$:cocos2d.h>") endif() diff --git a/cocos/scripting/js-bindings/CMakeLists.txt b/cocos/scripting/js-bindings/CMakeLists.txt index 4f59bd45c8f5..20e76ba4976e 100644 --- a/cocos/scripting/js-bindings/CMakeLists.txt +++ b/cocos/scripting/js-bindings/CMakeLists.txt @@ -180,9 +180,8 @@ if(XCODE OR VS) cocos_mark_code_files("jscocos2d") endif() -if(WINDOWS) - # precompiled header - target_sources(jscocos2d PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp") - set_target_properties(jscocos2d PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h") - set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h") +if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") + message("CMake 3.16 target_precompile_headers") + target_precompile_headers(jscocos2d PRIVATE + "$<$:precheader.h>") endif() diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 3a50f178aa2b..fd9accbd01f0 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -486,9 +486,8 @@ if(LINUX OR WINDOWS) cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER}) endif() -if(WINDOWS) - # precompiled header. Compilation time speedup ~4x. - target_sources(${APP_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/Classes/precheader.cpp") - set_target_properties(${APP_NAME} PROPERTIES COMPILE_FLAGS "/Yuprecheader.h /FIprecheader.h") - set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/Classes/precheader.cpp" PROPERTIES COMPILE_FLAGS "/Ycprecheader.h") +if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") + message("CMake 3.16 target_precompile_headers") + target_precompile_headers(${APP_NAME} PRIVATE + "$<$:Classes/precheader.h>") endif() From 07e7401bc31018320805366aa5a2d255c1a7a1d9 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 14:40:03 +0100 Subject: [PATCH 30/44] change path --- tests/cpp-tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index fd9accbd01f0..a9149e9f05c9 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -489,5 +489,5 @@ endif() if(${CMAKE_VERSION} VERSION_GREATER "3.16.0") message("CMake 3.16 target_precompile_headers") target_precompile_headers(${APP_NAME} PRIVATE - "$<$:Classes/precheader.h>") + "$<$:precheader.h>") endif() From 5cf95bb7b4cad61b9a878c6e1782298c0a408806 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 15:02:22 +0100 Subject: [PATCH 31/44] add xcode --- .github/workflows/main.yml | 4 ++-- cocos/CMakeLists.txt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1d1f80ab020..00688703edb5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . + - run: cmake -B b -S . -GXcode - run: cmake --build b macos-11: @@ -59,7 +59,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . + - run: cmake -B b -S . -GXcode - run: cmake --build b macos-10_15_ios: diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 410a24e03034..b61ee92b08cc 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -29,6 +29,10 @@ # build luacocos2d if BUILD_LUA_LIBS=ON # build jscocos2d if BUILD_JS_LIBS=ON +# https://gitlab.kitware.com/cmake/cmake/-/issues/22304#note_973092 +# If you don't enable OBCXX language to your project you will get the C++ compiler to compile your Objective-C++ files +# project(cocos2d LANGUAGES CXX OBJCXX) + # The version number set(COCOS2D_X_VERSION 3.17.2) From 6a26d8c0128eef6eb1f1e21a1378da957ba87b90 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 15:05:22 +0100 Subject: [PATCH 32/44] mac cpp-tests only --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00688703edb5..75f59e9dfcd6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode - - run: cmake --build b + - run: cmake --build b --target cpp-tests macos-11: runs-on: macos-11 @@ -60,7 +60,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode - - run: cmake --build b + - run: cmake --build b --target cpp-tests macos-10_15_ios: runs-on: macos-10.15 From 312e4379e9cdf07c05e04aed814b9bab1b8b7ad6 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 16:49:27 +0100 Subject: [PATCH 33/44] pch --- .github/workflows/main.yml | 33 +++++++++++++++++++++++++-------- cocos/CMakeLists.txt | 2 +- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75f59e9dfcd6..f5d4ec2c3514 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,14 +21,15 @@ jobs: - run: cmake -B b -S . - run: cmake --build b - ubuntu-20_04: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: echo -e "y" | bash build/install-deps-linux.sh - - run: cmake -B b -S . - - run: cmake --build b + # https://github.com/cocos2d/cocos2d-x/issues/20471 + # ubuntu-20_04: + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v2 + # - run: python download-deps.py --r no + # - run: echo -e "y" | bash build/install-deps-linux.sh + # - run: cmake -B b -S . + # - run: cmake --build b windows-2019: runs-on: windows-2019 @@ -46,6 +47,22 @@ jobs: - run: cmake -B b -S . -G "Visual Studio 17 2022" -A Win32 - run: cmake --build b + macos-10_15: + runs-on: macos-10.15 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . + - run: cmake --build b + + macos-11: + runs-on: macos-11 + steps: + - uses: actions/checkout@v2 + - run: python download-deps.py --r no + - run: cmake -B b -S . + - run: cmake --build b + macos-10_15: runs-on: macos-10.15 steps: diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index b61ee92b08cc..0005aa91c62e 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -31,7 +31,7 @@ # https://gitlab.kitware.com/cmake/cmake/-/issues/22304#note_973092 # If you don't enable OBCXX language to your project you will get the C++ compiler to compile your Objective-C++ files -# project(cocos2d LANGUAGES CXX OBJCXX) +project(cocos2d LANGUAGES LANGUAGES CXX OBJCXX) # The version number set(COCOS2D_X_VERSION 3.17.2) From e19b4865c31b41a609e718618924feadb99d8007 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 16:51:09 +0100 Subject: [PATCH 34/44] xcode --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5d4ec2c3514..9c3d165ecdbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,7 @@ jobs: - run: cmake -B b -S . - run: cmake --build b - macos-10_15: + macos-10_15_xcode: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 @@ -71,7 +71,7 @@ jobs: - run: cmake -B b -S . -GXcode - run: cmake --build b --target cpp-tests - macos-11: + macos-11_xcode: runs-on: macos-11 steps: - uses: actions/checkout@v2 From 7428990eab643290e0a27e67d17c8d714cc176cc Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 16:53:56 +0100 Subject: [PATCH 35/44] xcode --- cocos/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 0005aa91c62e..33985f9fe591 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -31,7 +31,7 @@ # https://gitlab.kitware.com/cmake/cmake/-/issues/22304#note_973092 # If you don't enable OBCXX language to your project you will get the C++ compiler to compile your Objective-C++ files -project(cocos2d LANGUAGES LANGUAGES CXX OBJCXX) +project(cocos2d LANGUAGES CXX OBJCXX) # The version number set(COCOS2D_X_VERSION 3.17.2) From 9ebb125941e707fff44ad7feb1d2a314ac56934a Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 17:03:33 +0100 Subject: [PATCH 36/44] xcode --- .github/workflows/main.yml | 18 +----------------- cocos/CMakeLists.txt | 4 ---- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c3d165ecdbb..91e471c9e11b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,22 +48,6 @@ jobs: - run: cmake --build b macos-10_15: - runs-on: macos-10.15 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . - - run: cmake --build b - - macos-11: - runs-on: macos-11 - steps: - - uses: actions/checkout@v2 - - run: python download-deps.py --r no - - run: cmake -B b -S . - - run: cmake --build b - - macos-10_15_xcode: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 @@ -71,7 +55,7 @@ jobs: - run: cmake -B b -S . -GXcode - run: cmake --build b --target cpp-tests - macos-11_xcode: + macos-11: runs-on: macos-11 steps: - uses: actions/checkout@v2 diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 33985f9fe591..410a24e03034 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -29,10 +29,6 @@ # build luacocos2d if BUILD_LUA_LIBS=ON # build jscocos2d if BUILD_JS_LIBS=ON -# https://gitlab.kitware.com/cmake/cmake/-/issues/22304#note_973092 -# If you don't enable OBCXX language to your project you will get the C++ compiler to compile your Objective-C++ files -project(cocos2d LANGUAGES CXX OBJCXX) - # The version number set(COCOS2D_X_VERSION 3.17.2) From 6b4ed13be9eb46e777236cc84c42236f7e602242 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 17:15:14 +0100 Subject: [PATCH 37/44] android pch --- .github/workflows/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91e471c9e11b..ed20b6b409c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,10 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info + - name: build, optional set cmake to cmake in path + run: | + echo cmake.dir=`where cmake` > local.properties + ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info shell: bash working-directory: tests/cpp-tests/proj.android @@ -93,6 +96,9 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info + - name: build, optional set cmake to cmake in path + run: | + echo cmake.dir=`which cmake` > local.properties + ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info shell: bash working-directory: tests/cpp-tests/proj.android From 22b26893516e653a0112a8039cf3d05bcec58ea6 Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 17:22:37 +0100 Subject: [PATCH 38/44] 3.18.0+ --- templates/cpp-template-default/proj.android/app/build.gradle | 1 + tests/cpp-empty-test/proj.android/app/build.gradle | 1 + tests/cpp-tests/proj.android/app/build.gradle | 1 + tests/js-tests/project/proj.android/app/build.gradle | 1 + tests/lua-empty-test/project/proj.android/app/build.gradle | 1 + tests/lua-tests/project/proj.android/app/build.gradle | 1 + 6 files changed, 6 insertions(+) diff --git a/templates/cpp-template-default/proj.android/app/build.gradle b/templates/cpp-template-default/proj.android/app/build.gradle index 37f771e03e76..32fed7bb5dfc 100644 --- a/templates/cpp-template-default/proj.android/app/build.gradle +++ b/templates/cpp-template-default/proj.android/app/build.gradle @@ -62,6 +62,7 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" + version "3.18.0+" } } } diff --git a/tests/cpp-empty-test/proj.android/app/build.gradle b/tests/cpp-empty-test/proj.android/app/build.gradle index 69148d806dc5..815b2026d176 100644 --- a/tests/cpp-empty-test/proj.android/app/build.gradle +++ b/tests/cpp-empty-test/proj.android/app/build.gradle @@ -63,6 +63,7 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" + version "3.18.0+" } } } diff --git a/tests/cpp-tests/proj.android/app/build.gradle b/tests/cpp-tests/proj.android/app/build.gradle index 919d60d99ee3..7bc778667355 100644 --- a/tests/cpp-tests/proj.android/app/build.gradle +++ b/tests/cpp-tests/proj.android/app/build.gradle @@ -62,6 +62,7 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" + version "3.18.0+" } } } diff --git a/tests/js-tests/project/proj.android/app/build.gradle b/tests/js-tests/project/proj.android/app/build.gradle index 3d65f1b7c2f5..940e9465c43a 100644 --- a/tests/js-tests/project/proj.android/app/build.gradle +++ b/tests/js-tests/project/proj.android/app/build.gradle @@ -62,6 +62,7 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" + version "3.18.0+" } } } diff --git a/tests/lua-empty-test/project/proj.android/app/build.gradle b/tests/lua-empty-test/project/proj.android/app/build.gradle index a98f4131b9fa..fc6059b586d8 100644 --- a/tests/lua-empty-test/project/proj.android/app/build.gradle +++ b/tests/lua-empty-test/project/proj.android/app/build.gradle @@ -62,6 +62,7 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" + version "3.18.0+" } } } diff --git a/tests/lua-tests/project/proj.android/app/build.gradle b/tests/lua-tests/project/proj.android/app/build.gradle index 2b45604699d7..72890030b313 100644 --- a/tests/lua-tests/project/proj.android/app/build.gradle +++ b/tests/lua-tests/project/proj.android/app/build.gradle @@ -62,6 +62,7 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" + version "3.18.0+" } } } From 713eb6301e6cc59fc0e07704b97d60a966b9e21a Mon Sep 17 00:00:00 2001 From: CHP Date: Thu, 2 Dec 2021 17:32:10 +0100 Subject: [PATCH 39/44] a --- .github/workflows/main.yml | 10 ++-------- .../cpp-template-default/proj.android/app/build.gradle | 1 - tests/cpp-empty-test/proj.android/app/build.gradle | 1 - tests/cpp-tests/proj.android/app/build.gradle | 1 - tests/js-tests/project/proj.android/app/build.gradle | 1 - .../project/proj.android/app/build.gradle | 1 - tests/lua-tests/project/proj.android/app/build.gradle | 1 - 7 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed20b6b409c8..91e471c9e11b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,10 +84,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - name: build, optional set cmake to cmake in path - run: | - echo cmake.dir=`where cmake` > local.properties - ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info + - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info shell: bash working-directory: tests/cpp-tests/proj.android @@ -96,9 +93,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - name: build, optional set cmake to cmake in path - run: | - echo cmake.dir=`which cmake` > local.properties - ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info + - run: ./gradlew assembleRelease -PPROP_BUILD_TYPE=cmake --info shell: bash working-directory: tests/cpp-tests/proj.android diff --git a/templates/cpp-template-default/proj.android/app/build.gradle b/templates/cpp-template-default/proj.android/app/build.gradle index 32fed7bb5dfc..37f771e03e76 100644 --- a/templates/cpp-template-default/proj.android/app/build.gradle +++ b/templates/cpp-template-default/proj.android/app/build.gradle @@ -62,7 +62,6 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" - version "3.18.0+" } } } diff --git a/tests/cpp-empty-test/proj.android/app/build.gradle b/tests/cpp-empty-test/proj.android/app/build.gradle index 815b2026d176..69148d806dc5 100644 --- a/tests/cpp-empty-test/proj.android/app/build.gradle +++ b/tests/cpp-empty-test/proj.android/app/build.gradle @@ -63,7 +63,6 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" - version "3.18.0+" } } } diff --git a/tests/cpp-tests/proj.android/app/build.gradle b/tests/cpp-tests/proj.android/app/build.gradle index 7bc778667355..919d60d99ee3 100644 --- a/tests/cpp-tests/proj.android/app/build.gradle +++ b/tests/cpp-tests/proj.android/app/build.gradle @@ -62,7 +62,6 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" - version "3.18.0+" } } } diff --git a/tests/js-tests/project/proj.android/app/build.gradle b/tests/js-tests/project/proj.android/app/build.gradle index 940e9465c43a..3d65f1b7c2f5 100644 --- a/tests/js-tests/project/proj.android/app/build.gradle +++ b/tests/js-tests/project/proj.android/app/build.gradle @@ -62,7 +62,6 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" - version "3.18.0+" } } } diff --git a/tests/lua-empty-test/project/proj.android/app/build.gradle b/tests/lua-empty-test/project/proj.android/app/build.gradle index fc6059b586d8..a98f4131b9fa 100644 --- a/tests/lua-empty-test/project/proj.android/app/build.gradle +++ b/tests/lua-empty-test/project/proj.android/app/build.gradle @@ -62,7 +62,6 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" - version "3.18.0+" } } } diff --git a/tests/lua-tests/project/proj.android/app/build.gradle b/tests/lua-tests/project/proj.android/app/build.gradle index 72890030b313..2b45604699d7 100644 --- a/tests/lua-tests/project/proj.android/app/build.gradle +++ b/tests/lua-tests/project/proj.android/app/build.gradle @@ -62,7 +62,6 @@ android { else if (PROP_BUILD_TYPE == 'cmake') { cmake { path "../../CMakeLists.txt" - version "3.18.0+" } } } From 6572a71d5d0e2b738f721cb9f6c7a7c41cb4376f Mon Sep 17 00:00:00 2001 From: CHP Date: Fri, 3 Dec 2021 12:22:20 +0100 Subject: [PATCH 40/44] andoid at front --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91e471c9e11b..4d19ac374923 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,23 +63,23 @@ jobs: - run: cmake -B b -S . -GXcode - run: cmake --build b --target cpp-tests - macos-10_15_ios: + ios_macos-10_15: runs-on: macos-10.15 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_SYSTEM_PROCESSOR=arm64 - run: cmake --build b --config Release --target cpp-tests -- -quiet - macos-11_ios: + ios_macos-11: runs-on: macos-11 steps: - uses: actions/checkout@v2 - run: python download-deps.py --r no - - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator + - run: cmake -B b -S . -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_SYSTEM_PROCESSOR=arm64 - run: cmake --build b --config Release --target cpp-tests -- -quiet -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" - windows-2019-android: + android_windows-2019: runs-on: windows-2019 steps: - uses: actions/checkout@v2 @@ -88,7 +88,7 @@ jobs: shell: bash working-directory: tests/cpp-tests/proj.android - ubuntu-20_04-android: + android_ubuntu-20_04: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 From e7b39c5c71a211623c57eb13ce15d6ac6080ed6e Mon Sep 17 00:00:00 2001 From: CHP Date: Fri, 3 Dec 2021 13:50:26 +0100 Subject: [PATCH 41/44] ONLY_ACTIVE_ARCH 'YES' --- cmake/Modules/CocosBuildHelpers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/CocosBuildHelpers.cmake b/cmake/Modules/CocosBuildHelpers.cmake index f9d46060b682..275364543742 100644 --- a/cmake/Modules/CocosBuildHelpers.cmake +++ b/cmake/Modules/CocosBuildHelpers.cmake @@ -269,9 +269,9 @@ endmacro() # custom Xcode property for iOS target macro(cocos_config_target_xcode_property cocos_target) if(IOS) - set_xcode_property(${cocos_target} IPHONEOS_DEPLOYMENT_TARGET "9.0") + set_xcode_property(${cocos_target} IPHONEOS_DEPLOYMENT_TARGET "11.0") set_xcode_property(${cocos_target} ENABLE_BITCODE "NO") - set_xcode_property(${cocos_target} ONLY_ACTIVE_ARCH "YES") + # set_xcode_property(${cocos_target} ONLY_ACTIVE_ARCH "YES") endif() endmacro() From b99910e562e04200db58ec34081a524784238ba2 Mon Sep 17 00:00:00 2001 From: CHP Date: Fri, 3 Dec 2021 14:16:02 +0100 Subject: [PATCH 42/44] rollback --- cmake/Modules/CocosBuildHelpers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/CocosBuildHelpers.cmake b/cmake/Modules/CocosBuildHelpers.cmake index 275364543742..f9d46060b682 100644 --- a/cmake/Modules/CocosBuildHelpers.cmake +++ b/cmake/Modules/CocosBuildHelpers.cmake @@ -269,9 +269,9 @@ endmacro() # custom Xcode property for iOS target macro(cocos_config_target_xcode_property cocos_target) if(IOS) - set_xcode_property(${cocos_target} IPHONEOS_DEPLOYMENT_TARGET "11.0") + set_xcode_property(${cocos_target} IPHONEOS_DEPLOYMENT_TARGET "9.0") set_xcode_property(${cocos_target} ENABLE_BITCODE "NO") - # set_xcode_property(${cocos_target} ONLY_ACTIVE_ARCH "YES") + set_xcode_property(${cocos_target} ONLY_ACTIVE_ARCH "YES") endif() endmacro() From 0908cd8c3ee131f528bf83c4e2d828801c786b1c Mon Sep 17 00:00:00 2001 From: CHP Date: Fri, 3 Dec 2021 14:48:25 +0100 Subject: [PATCH 43/44] Remove --target --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d19ac374923..26e9dbd5d123 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode - - run: cmake --build b --target cpp-tests + - run: cmake --build b macos-11: runs-on: macos-11 @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode - - run: cmake --build b --target cpp-tests + - run: cmake --build b ios_macos-10_15: runs-on: macos-10.15 From c9b88dbc678c694c63c103a3ea85e00f4feb42ec Mon Sep 17 00:00:00 2001 From: CHP Date: Fri, 3 Dec 2021 15:08:50 +0100 Subject: [PATCH 44/44] a --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26e9dbd5d123..4d19ac374923 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode - - run: cmake --build b + - run: cmake --build b --target cpp-tests macos-11: runs-on: macos-11 @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v2 - run: python download-deps.py --r no - run: cmake -B b -S . -GXcode - - run: cmake --build b + - run: cmake --build b --target cpp-tests ios_macos-10_15: runs-on: macos-10.15