From 3ba3be54b09eb6ab15d8fcf0d1a2b2d8e17d80b2 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 28 Jun 2024 20:57:47 +0200 Subject: [PATCH 1/3] add more variables to pkg-config file, to detect libc++ or libstdc++ of the build libraries --- src/libs/core/meson.build | 21 +++++++++++---------- src/libs/meson.build | 6 ++++++ src/libs/recordings/meson.build | 1 + 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/libs/core/meson.build b/src/libs/core/meson.build index 96cdf964..186ade85 100644 --- a/src/libs/core/meson.build +++ b/src/libs/core/meson.build @@ -22,18 +22,10 @@ liboopetris_core = library( install: true, ) -## remove '-stdlib=libc++' from the list, if it's present -core_dep_compile_args = [] -foreach value : core_lib.get('compile_args') - if value != '-stdlib=libc++' - core_dep_compile_args += value - endif -endforeach - liboopetris_core_dep = declare_dependency( link_with: liboopetris_core, include_directories: core_lib.get('inc_dirs'), - compile_args: core_dep_compile_args, + compile_args: core_lib.get('compile_args'), dependencies: core_lib.get('deps'), version: meson.project_version(), ) @@ -45,6 +37,14 @@ install_headers( preserve_path: true, ) +## remove '-stdlib=libc++' from the list, if it's present +core_dep_compile_args = [] +foreach value : core_lib.get('compile_args') + if value != '-stdlib=libc++' + core_dep_compile_args += value + endif +endforeach + # generate pkgconfig files pkg = import('pkgconfig') @@ -54,7 +54,8 @@ pkg.generate( name: 'oopetris-core', filebase: 'oopetris-core', subdirs: 'oopetris', - extra_cflags: core_lib.get('compile_args'), + extra_cflags: core_dep_compile_args, + variables: ['compiler=' + pkg_cpp_compiler, 'cpp_stdlib=' + pkg_cpp_stdlib], ) # setting this to strings, so += {...} gets detected as an error, if it is done after that diff --git a/src/libs/meson.build b/src/libs/meson.build index 7f80bbb9..5b2b2cd1 100644 --- a/src/libs/meson.build +++ b/src/libs/meson.build @@ -4,6 +4,12 @@ core_lib += { 'inc_dirs': [core_lib.get('inc_dirs'), include_directories('.')], } +pkg_cpp_compiler = cpp.get_id() +pkg_cpp_stdlib = 'unknown' +if cpp.get_id() == 'clang' + pkg_cpp_stdlib = build_with_libcpp ? 'libc++' : 'libstdc++' +endif + subdir('core') recordings_lib += { diff --git a/src/libs/recordings/meson.build b/src/libs/recordings/meson.build index e1a93e85..af6148fc 100644 --- a/src/libs/recordings/meson.build +++ b/src/libs/recordings/meson.build @@ -49,6 +49,7 @@ pkg.generate( filebase: 'oopetris-recordings', subdirs: 'oopetris', extra_cflags: recordings_lib.get('compile_args'), + variables: ['compiler=' + pkg_cpp_compiler, 'cpp_stdlib=' + pkg_cpp_stdlib], ) # setting this to strings, so += {...} gets detected as an error, if it is done after that From b479e8ee8720a2e45da6bf4341d33076e91def20 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 28 Jun 2024 22:52:11 +0200 Subject: [PATCH 2/3] CI, rename steps and also meson to build --- .github/workflows/{meson.yml => build.yml} | 2 +- .github/workflows/installer.yml | 2 +- .github/workflows/nintendo.yml | 2 +- .github/workflows/test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{meson.yml => build.yml} (99%) diff --git a/.github/workflows/meson.yml b/.github/workflows/build.yml similarity index 99% rename from .github/workflows/meson.yml rename to .github/workflows/build.yml index a16ef53f..2ed1f175 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Meson CI +name: Build CI on: push: diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index eb4a76aa..ec4fdaad 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - build: + installer: name: ${{ matrix.config.name }} runs-on: ${{ matrix.config.os }}-${{ matrix.config.os-version }} diff --git a/.github/workflows/nintendo.yml b/.github/workflows/nintendo.yml index 3163c1d9..161e9054 100644 --- a/.github/workflows/nintendo.yml +++ b/.github/workflows/nintendo.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - build: + nintendo-build: name: Nintendo ${{ matrix.config.name }} CI runs-on: ubuntu-24.04 container: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84690e97..ec154a70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - build: + test: name: Run Tests runs-on: ubuntu-24.04 steps: From 91a56e5e28afdb917aa82d75651bae76802a4367 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Fri, 28 Jun 2024 23:08:26 +0200 Subject: [PATCH 3/3] add new wrapper submodule: python --- .gitmodules | 3 +++ wrapper/README.md | 5 +++-- wrapper/python | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 160000 wrapper/python diff --git a/.gitmodules b/.gitmodules index 0023a990..167b53a5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "wrapper/haskell"] path = wrapper/haskell url = https://github.com/Totto16/oopetris_wrapper_haskell.git +[submodule "wrapper/python"] + path = wrapper/python + url = https://github.com/Totto16/oopetris_wrapper_python.git diff --git a/wrapper/README.md b/wrapper/README.md index 3982963d..9442f12e 100644 --- a/wrapper/README.md +++ b/wrapper/README.md @@ -2,7 +2,7 @@ ## What is this -This are wrappers of some OOPEtris functionaility in other languages. +This are wrappers of some OOPetris functionaility in other languages. They are all in submodules alias in a seperate git repo. They currently wrap this: @@ -18,11 +18,12 @@ Current: - Node.js (C++ binding) - C (C++ binding) - Haskell (C binding) +- Python (C++ binding) Planned: -- Python - Lua - Java +- Rust ## Other diff --git a/wrapper/python b/wrapper/python new file mode 160000 index 00000000..be791d08 --- /dev/null +++ b/wrapper/python @@ -0,0 +1 @@ +Subproject commit be791d089dc22cee0e183ad97044a4cc2482926b