Skip to content

Commit 56ca719

Browse files
authored
Merge pull request #168 from OpenBrickProtocolFoundation/pkg-config-variables
add more variables to pkg-config file
2 parents 5fca947 + 91a56e5 commit 56ca719

File tree

10 files changed

+29
-16
lines changed

10 files changed

+29
-16
lines changed

.github/workflows/meson.yml renamed to .github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Meson CI
1+
name: Build CI
22

33
on:
44
push:

.github/workflows/installer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
10+
installer:
1111
name: ${{ matrix.config.name }}
1212
runs-on: ${{ matrix.config.os }}-${{ matrix.config.os-version }}
1313

.github/workflows/nintendo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
10+
nintendo-build:
1111
name: Nintendo ${{ matrix.config.name }} CI
1212
runs-on: ubuntu-24.04
1313
container:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build:
10+
test:
1111
name: Run Tests
1212
runs-on: ubuntu-24.04
1313
steps:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "wrapper/haskell"]
88
path = wrapper/haskell
99
url = https://github.com/Totto16/oopetris_wrapper_haskell.git
10+
[submodule "wrapper/python"]
11+
path = wrapper/python
12+
url = https://github.com/Totto16/oopetris_wrapper_python.git

src/libs/core/meson.build

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ liboopetris_core = library(
2222
install: true,
2323
)
2424

25-
## remove '-stdlib=libc++' from the list, if it's present
26-
core_dep_compile_args = []
27-
foreach value : core_lib.get('compile_args')
28-
if value != '-stdlib=libc++'
29-
core_dep_compile_args += value
30-
endif
31-
endforeach
32-
3325
liboopetris_core_dep = declare_dependency(
3426
link_with: liboopetris_core,
3527
include_directories: core_lib.get('inc_dirs'),
36-
compile_args: core_dep_compile_args,
28+
compile_args: core_lib.get('compile_args'),
3729
dependencies: core_lib.get('deps'),
3830
version: meson.project_version(),
3931
)
@@ -45,6 +37,14 @@ install_headers(
4537
preserve_path: true,
4638
)
4739

40+
## remove '-stdlib=libc++' from the list, if it's present
41+
core_dep_compile_args = []
42+
foreach value : core_lib.get('compile_args')
43+
if value != '-stdlib=libc++'
44+
core_dep_compile_args += value
45+
endif
46+
endforeach
47+
4848
# generate pkgconfig files
4949
pkg = import('pkgconfig')
5050

@@ -54,7 +54,8 @@ pkg.generate(
5454
name: 'oopetris-core',
5555
filebase: 'oopetris-core',
5656
subdirs: 'oopetris',
57-
extra_cflags: core_lib.get('compile_args'),
57+
extra_cflags: core_dep_compile_args,
58+
variables: ['compiler=' + pkg_cpp_compiler, 'cpp_stdlib=' + pkg_cpp_stdlib],
5859
)
5960

6061
# setting this to strings, so += {...} gets detected as an error, if it is done after that

src/libs/meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ core_lib += {
44
'inc_dirs': [core_lib.get('inc_dirs'), include_directories('.')],
55
}
66

7+
pkg_cpp_compiler = cpp.get_id()
8+
pkg_cpp_stdlib = 'unknown'
9+
if cpp.get_id() == 'clang'
10+
pkg_cpp_stdlib = build_with_libcpp ? 'libc++' : 'libstdc++'
11+
endif
12+
713
subdir('core')
814

915
recordings_lib += {

src/libs/recordings/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pkg.generate(
4949
filebase: 'oopetris-recordings',
5050
subdirs: 'oopetris',
5151
extra_cflags: recordings_lib.get('compile_args'),
52+
variables: ['compiler=' + pkg_cpp_compiler, 'cpp_stdlib=' + pkg_cpp_stdlib],
5253
)
5354

5455
# setting this to strings, so += {...} gets detected as an error, if it is done after that

wrapper/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What is this
44

5-
This are wrappers of some OOPEtris functionaility in other languages.
5+
This are wrappers of some OOPetris functionaility in other languages.
66
They are all in submodules alias in a seperate git repo.
77

88
They currently wrap this:
@@ -18,11 +18,12 @@ Current:
1818
- Node.js (C++ binding)
1919
- C (C++ binding)
2020
- Haskell (C binding)
21+
- Python (C++ binding)
2122

2223
Planned:
23-
- Python
2424
- Lua
2525
- Java
26+
- Rust
2627

2728
## Other
2829

wrapper/python

Submodule python added at be791d0

0 commit comments

Comments
 (0)