Skip to content

Commit

Permalink
build: pass staticdeps parameter to libtrx
Browse files Browse the repository at this point in the history
When trying to link dynamically to required dependencies with
-Dstaticdeps=false parameter, meson produces 95 warnings.

To fix them, staticdeps parameter must be passed to libtrx subproject.

Current partial output :
> meson setup -Doptimization=2 -Db_asneeded=true
> --prefix=/var/tmp/devcxx/meson/TR1X/installdir
> /var/tmp/devcxx/meson/TR1X/builddir
> [...]/dev/projects/TRX/src/tr1 -Dstaticdeps=false
>
> [...]
>
>  TR1X undefined
>
>   Subprojects
>     libtrx      : YES 95 warnings
>     uthash      : YES (from libtrx)
>
>   User defined options
>     optimization: 2
>     prefix      : /var/tmp/devcxx/meson/TR1X/installdir
>     b_asneeded  : true
>     staticdeps  : false

Signed-off-by: Fabrice Delliaux <[email protected]>
  • Loading branch information
netfab authored and rr- committed Nov 9, 2024
1 parent b51a2b7 commit b824523
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/tr1/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ project(
],
)

staticdeps = get_option('staticdeps')

trx = subproject('libtrx', default_options: {
'tr_version': '1',
'staticdeps': staticdeps,
})
c_compiler = meson.get_compiler('c')

Expand All @@ -24,8 +27,6 @@ build_opts = [

add_project_arguments(build_opts, language: 'c')

staticdeps = get_option('staticdeps')

# Always dynamically link on macOS
if host_machine.system() == 'darwin'
staticdeps = false
Expand Down
5 changes: 3 additions & 2 deletions src/tr2/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ project('TR2X', ['c'],
],
)

staticdeps = get_option('staticdeps')

trx = subproject('libtrx', default_options: {
'tr_version': '2',
'staticdeps': staticdeps,
})
c_compiler = meson.get_compiler('c')

Expand All @@ -22,8 +25,6 @@ build_opts = [

add_project_arguments(build_opts, language: 'c')

staticdeps = get_option('staticdeps')

null_dep = dependency('', required: false)
dep_trx = trx.get_variable('dep_trx')
dep_sdl2 = dependency('SDL2', static: staticdeps)
Expand Down

0 comments on commit b824523

Please sign in to comment.