Skip to content

Commit

Permalink
Add initial meson build system
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Mar 4, 2024
1 parent e403a6b commit 3ea3548
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 0 deletions.
48 changes: 48 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
project('mandelbrot', 'rust',
version : '0.1.0',
meson_version : '>= 1.0.0',
default_options : ['buildtype=debugoptimized',
'rust_std=2018',
'futures-core-0.3-rs:feature-default=true',
'futures-task-0.3-rs:feature-std=true',
'futures-util-0.3-rs:feature-default=true',
'proc-macro2-1-rs:feature-default=true',
'proc-macro2-1-rs:feature-proc-macro=true',
'syn-1-rs:feature-default=true',
'syn-1-rs:feature-full=true',
'crossbeam-utils-0.8-rs:feature-default=true',
'smallvec-1-rs:feature-default=true',
'smallvec-1-rs:feature-write=true',
'glib-sys-0.19-rs:feature-v2_66=true',
'gobject-sys-0.19-rs:feature-v2_66=true',
'gio-sys-0.19-rs:feature-v2_66=true',
'glib-0.19-rs:feature-v2_66=true',
'gio-0.19-rs:feature-v2_66=true',
]
)

rustc = meson.get_compiler('rust')

add_global_arguments(
'-C', 'embed-bitcode=no',
language: 'rust'
)

num_complex = subproject('num-complex-0.4-rs')
num_complex_dep = num_complex.get_variable('dep')
rayon = subproject('rayon-1-rs')
rayon_dep = rayon.get_variable('dep')
once_cell = subproject('once_cell-1-rs')
once_cell_dep = once_cell.get_variable('dep')
async_channel = subproject('async-channel-2-rs')
async_channel_dep = async_channel.get_variable('dep')
gtk = subproject('gtk4-0.8-rs')
gtk_dep = gtk.get_variable('dep')

executable('mandelbrot', 'src/main.rs',
rust_dependency_map : {
'gtk4' : 'gtk',
},
dependencies : [gtk_dep, num_complex_dep, rayon_dep, once_cell_dep, async_channel_dep],
install : true,
)
6 changes: 6 additions & 0 deletions subprojects/async-channel-2-rs.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-file]
directory = async-channel-2.2.0
source_url = https://crates.io/api/v1/crates/async-channel/2.2.0/download
source_filename = async-channel-2.2.0.tar.gz
source_hash = f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3
method = cargo
6 changes: 6 additions & 0 deletions subprojects/gtk4-0.8-rs.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-file]
directory = gtk4-0.8.0
source_url = https://crates.io/api/v1/crates/gtk4/0.8.0/download
source_filename = gtk4-0.8.0.tar.gz
source_hash = 7d26ffa3ec6316ccaa1df62d3e7f5bae1637c0acbb43f250fabef38319f73c64
method = cargo
6 changes: 6 additions & 0 deletions subprojects/num-complex-0.4-rs.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-file]
directory = num-complex-0.4.5
source_url = https://crates.io/api/v1/crates/num-complex/0.4.5/download
source_filename = num-complex-0.4.5.tar.gz
source_hash = 23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6
method = cargo
6 changes: 6 additions & 0 deletions subprojects/once_cell-1-rs.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-file]
directory = once_cell-1.19.0
source_url = https://crates.io/api/v1/crates/once_cell/1.19.0/download
source_filename = once_cell-1.19.0.tar.gz
source_hash = 3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92
method = cargo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extra_args += '--cfg'
extra_args += 'use_fallback'
2 changes: 2 additions & 0 deletions subprojects/packagefiles/proc-macro2-1-rs/meson/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extra_args += '--cfg'
extra_args += 'wrap_proc_macro'
6 changes: 6 additions & 0 deletions subprojects/rayon-1-rs.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-file]
directory = rayon-1.9.0
source_url = https://crates.io/api/v1/crates/rayon/1.9.0/download
source_filename = rayon-1.9.0.tar.gz
source_hash = e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd
method = cargo

0 comments on commit 3ea3548

Please sign in to comment.