Skip to content

Commit

Permalink
Add static option for statically linked binary
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Woloschin <[email protected]>
  • Loading branch information
iwoloschin committed Nov 28, 2023
1 parent 6a5319d commit 757df84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ add_global_link_arguments('-z', 'noexecstack', language: 'c')
libfdt_dep = dependency('libfdt',
default_options: [ 'warning_level=1', ],
fallback: [ 'dtc', 'libfdt_dep' ],
required: true)
required: true,
static: get_option('static'))

libfdt_native_dep = dependency('dtc',
native: true,
Expand Down
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('static', type : 'boolean', value : false, description : 'Statically link the culvert binary')
4 changes: 4 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
fs = import('fs')

if get_option('static')
add_project_link_arguments('-static', language: 'c')
endif

incdirs = [ '.' ]

src = files(
Expand Down

0 comments on commit 757df84

Please sign in to comment.