Skip to content

add more variables to pkg-config file #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Meson CI
name: Build CI

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build:
installer:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}-${{ matrix.config.os-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nintendo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build:
nintendo-build:
name: Nintendo ${{ matrix.config.name }} CI
runs-on: ubuntu-24.04
container:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build:
test:
name: Run Tests
runs-on: ubuntu-24.04
steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 11 additions & 10 deletions src/libs/core/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand All @@ -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')

Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/libs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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 += {
Expand Down
1 change: 1 addition & 0 deletions src/libs/recordings/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -18,11 +18,12 @@ Current:
- Node.js (C++ binding)
- C (C++ binding)
- Haskell (C binding)
- Python (C++ binding)

Planned:
- Python
- Lua
- Java
- Rust

## Other

Expand Down
1 change: 1 addition & 0 deletions wrapper/python
Submodule python added at be791d