diff --git a/meson.build b/meson.build index 062c48a..e860390 100644 --- a/meson.build +++ b/meson.build @@ -59,7 +59,12 @@ debugcc_srcs += configure_file( output: 'platforms.c', configuration: platforms) +debugcc_link_args = [] +if not get_option('dynamic-linking') + debugcc_link_args += ['-static', '-static-libgcc'] +endif + executable('debugcc', debugcc_srcs, - link_args: ['-static','-static-libgcc'], + link_args: debugcc_link_args, install: true) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..6d1d19e --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,5 @@ +option('dynamic-linking', + type: 'boolean', + value: false, + description: 'Build debugcc as a dynamically linked binary instead of static', +)