meson: Add an option to disabling installing assemblies

This is useful when used as a subproject which is generating a Nuget.
This commit is contained in:
Thibault Saunier 2017-08-31 08:42:08 -03:00
parent 63264db8f3
commit 44d2af717a
17 changed files with 97 additions and 72 deletions

View file

@ -123,6 +123,6 @@ api_xml = custom_target(pkg + '_api_xml',
output: pkg + '-api.xml',
command: [generate_api, '--fakeglue'],
depends: [source_gen],
install: true,
install: install,
install_dir: gapi_xml_installdir)
atk_api_includes = join_paths(meson.current_build_dir(), 'atk-api.xml')

View file

@ -27,7 +27,7 @@ sources = [
atk_sharp = library(assembly_name, source_gen, sources,
cs_args: ['-unsafe', '-keyfile:' + snk],
link_with: glib_sharp,
install: true,
install: install,
install_dir: lib_install_dir
)
@ -39,7 +39,7 @@ gluegen = custom_target('atkgluegen',
library('atksharpglue-3', gluegen,
dependencies: [glib_dep, gio_dep, atk_dep],
install: true)
install: install)
install_infos += [assembly_name, atk_sharp.full_path()]
atk_sharp_dep = declare_dependency(link_with: [glib_sharp, atk_sharp])

View file

@ -65,12 +65,15 @@ sources = [
cairo_sharp = library(assembly_name, sources,
cs_args: ['-keyfile:' + snk],
install: true,
install: install,
install_dir: lib_install_dir
)
install_infos += [assembly_name, cairo_sharp.full_path()]
cairo_api_includes = join_paths(meson.current_source_dir(), 'cairo-api.xml')
install_data(cairo_api_includes, install_dir: gapi_xml_installdir)
if install
install_data(cairo_api_includes, install_dir: gapi_xml_installdir)
endif
cairo_sharp_dep = declare_dependency(link_with: cairo_sharp)

View file

@ -221,6 +221,6 @@ api_xml = custom_target(pkg + '_api_xml',
output: pkg + '-api.xml',
command: [generate_api, '--fakeglue'],
depends: [source_gen],
install: true,
install: install,
install_dir: gapi_xml_installdir)
gdk_api_includes = join_paths(meson.current_build_dir(), 'gdk-api.xml')

View file

@ -12,11 +12,12 @@ configure_file(input: assembly_name + '.dll.config.in',
output: assembly_name + '.dll.config',
configuration : remap_dl_data)
configure_file(input: assembly_name + '-3.0.pc.in',
output: assembly_name + '-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir,
install: true)
if install
configure_file(input: assembly_name + '-3.0.pc.in',
output: assembly_name + '-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir)
endif
subdir('generated')
@ -68,7 +69,7 @@ deps = [glib_sharp, pango_sharp, cairo_sharp, gio_sharp]
gdk_sharp = library(assembly_name, source_gen, sources,
cs_args: ['-unsafe', '-keyfile:' + snk],
link_with: deps,
install: true,
install: install,
install_dir: lib_install_dir
)
@ -80,7 +81,7 @@ gluegen = custom_target('gdkgluegen',
library('gdksharpglue-3', gluegen,
dependencies: [glib_dep, gio_dep, atk_dep, gdk_dep],
install: true)
install: install)
install_infos += [assembly_name, gdk_sharp.full_path()]
gdk_sharp_dep = declare_dependency(link_with: deps + [gdk_sharp])

View file

@ -1,13 +1,6 @@
gapi_fixup = executable('gapi-fixup', 'gapi-fixup.cs',
install_dir : gapi_installdir,
install: true)
configure_file(input: 'gapi3-fixup.in',
output: 'gapi3-fixup',
configuration : gapi_parser_data,
install_dir: get_option('bindir'),
install: true)
install: install)
gapi_codegen = executable('gapi_codegen',
'AliasGen.cs',
@ -73,10 +66,22 @@ gapi_codegen = executable('gapi_codegen',
'VMSignature.cs',
'XmlElementExtensions.cs',
install_dir : gapi_installdir,
install: true)
install: install)
configure_file(input: 'gapi3-codegen.in',
output: 'gapi3-codegen',
configuration : gapi_parser_data,
install_dir: get_option('bindir'),
install: true)
if install
configure_file(input: 'gapi3-fixup.in',
output: 'gapi3-fixup',
configuration : gapi_parser_data,
install_dir: get_option('bindir'))
configure_file(input: 'gapi3-codegen.in',
output: 'gapi3-codegen',
configuration : gapi_parser_data,
install_dir: get_option('bindir'))
else
configure_file(input: 'gapi3-fixup.in',
output: 'gapi3-fixup',
configuration : gapi_parser_data)
configure_file(input: 'gapi3-codegen.in',
output: 'gapi3-codegen',
configuration : gapi_parser_data)
endif

View file

@ -420,6 +420,6 @@ api_xml = custom_target(pkg + '_api_xml',
output: pkg + '-api.xml',
command: [generate_api, '--fakeglue'],
depends: [source_gen],
install: true,
install: install,
install_dir: gapi_xml_installdir)
gio_api_includes = join_paths(meson.current_build_dir(), 'gio-api.xml')

View file

@ -11,11 +11,12 @@ configure_file(input: assembly_name + '.dll.config.in',
output: assembly_name + '.dll.config',
configuration : remap_dl_data)
configure_file(input: assembly_name + '-3.0.pc.in',
output: assembly_name + '-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir,
install: true)
if install
configure_file(input: assembly_name + '-3.0.pc.in',
output: assembly_name + '-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir)
endif
subdir('generated')
@ -33,7 +34,7 @@ sources = [
gio_sharp = library(assembly_name, source_gen, sources,
cs_args: ['-unsafe', '-keyfile:' + snk],
link_with: glib_sharp,
install: true,
install: install,
install_dir: lib_install_dir
)
@ -43,9 +44,9 @@ gluegen = custom_target('giogluegen',
command: [generate_api, '--fakeglue'],
depends: [source_gen])
library('giosharpglue-3', gluegen,
gio_glue = library('giosharpglue-3', gluegen,
dependencies: [glib_dep, gio_dep],
install: true)
install: install)
install_infos += [assembly_name, gio_sharp.full_path()]
gio_sharp_dep = declare_dependency(link_with: [glib_sharp, gio_sharp])

View file

@ -819,11 +819,11 @@ namespace GLib {
return g_type_check_instance_is_a (obj, GType.Object.Val);
}
struct GTypeInstance {
public struct GTypeInstance {
public IntPtr g_class;
}
struct GObject {
public struct GObject {
public GTypeInstance type_instance;
public uint ref_count;
public IntPtr qdata;

View file

@ -5,11 +5,13 @@ configure_file(input: 'glib-sharp.dll.config.in',
output: 'glib-sharp.dll.config',
configuration : remap_dl_data)
configure_file(input: 'glib-sharp-3.0.pc.in',
output: 'glib-sharp-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir,
install: true)
if install
configure_file(input: 'glib-sharp-3.0.pc.in',
output: 'glib-sharp-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir,
install: install)
endif
policy_data = configuration_data()
policy_data.set('ASSEMBLY_NAME', assembly_name)
@ -92,13 +94,16 @@ sources = [
glib_sharp = library(assembly_name, sources,
cs_args: ['-unsafe', '-keyfile:' + snk],
install: true,
install: install,
install_dir: lib_install_dir
)
install_infos += [assembly_name, glib_sharp.full_path()]
glib_api_includes = join_paths(meson.current_source_dir(), 'glib-api.xml')
install_data(glib_api_includes, install_dir: gapi_xml_installdir)
if install
install_data(glib_api_includes, install_dir: gapi_xml_installdir)
endif
glib_sharp_dep = declare_dependency(link_with: glib_sharp)

View file

@ -1089,6 +1089,6 @@ api_xml = custom_target(pkg + '_api_xml',
output: pkg + '-api.xml',
command: [generate_api, '--fakeglue'],
depends: [source_gen],
install: true,
install: install,
install_dir: gapi_xml_installdir)
gtk_api_includes = join_paths(meson.current_build_dir(), 'gtk-api.xml')

View file

@ -12,11 +12,12 @@ configure_file(input: assembly_name + '.dll.config.in',
output: assembly_name + '.dll.config',
configuration : remap_dl_data)
configure_file(input: assembly_name + '-3.0.pc.in',
output: assembly_name + '-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir,
install: true)
if install
configure_file(input: assembly_name + '-3.0.pc.in',
output: assembly_name + '-3.0.pc',
configuration : version_data,
install_dir: pkg_install_dir)
endif
subdir('generated')
@ -136,7 +137,7 @@ deps = [glib_sharp, pango_sharp, cairo_sharp, gio_sharp, atk_sharp, gdk_sharp]
gtk_sharp = library(assembly_name, source_gen, sources,
cs_args: ['-unsafe', '-keyfile:' + snk, '-nowarn:0618,0612,0169'],
link_with: deps,
install: true,
install: install,
install_dir: lib_install_dir
)
@ -148,7 +149,7 @@ gluegen = custom_target('gtkgluegen',
library('gtksharpglue-3', gluegen,
dependencies: [glib_dep, gio_dep, atk_dep, gdk_dep, gtk_dep],
install: true)
install: install)
install_infos += [assembly_name, gtk_sharp.full_path()]
gtk_sharp_dep = declare_dependency(link_with: deps + [gtk_sharp])

View file

@ -30,6 +30,7 @@ if csc.get_id() == 'mono'
endif
endif
install = get_option('install')
assemblyinfo='/AssemblyInfo.cs'
gacutil = find_program('gacutil')
@ -118,5 +119,7 @@ else
message('Gtk not found, not building')
endif
gacutil_install = join_paths(meson.current_source_dir(), 'gacutil_install.py')
meson.add_install_script(gacutil_install, install_infos)
if install
gacutil_install = join_paths(meson.current_source_dir(), 'gacutil_install.py')
meson.add_install_script(gacutil_install, install_infos)
endif

1
meson_options.txt Normal file
View file

@ -0,0 +1 @@
option('install', type : 'boolean', value : true)

View file

@ -138,6 +138,6 @@ api_xml = custom_target(pkg + '_api_xml',
output: pkg + '-api.xml',
command: [generate_api, '--fakeglue'],
depends: [source_gen],
install: true,
install: install,
install_dir: gapi_xml_installdir)
pango_api_includes = join_paths(meson.current_build_dir(), pkg + '-api.xml')

View file

@ -63,7 +63,7 @@ deps = [glib_sharp, cairo_sharp]
pango_sharp = library(assembly_name, source_gen, sources,
cs_args: ['-unsafe', '-keyfile:' + snk],
link_with: deps,
install: true,
install: install,
install_dir: lib_install_dir
)
@ -75,7 +75,7 @@ gluegen = custom_target('pangogluegen',
library('pangosharpglue-3', gluegen,
dependencies: [glib_dep, gio_dep, pango_dep],
install: true)
install: install)
install_infos += [assembly_name, pango_sharp.full_path()]
pango_sharp_dep = declare_dependency(link_with: deps + [pango_sharp])

View file

@ -3,24 +3,29 @@ pkg_install_dir = '@0@/pkgconfig'.format(get_option('libdir'))
gapi_parser = executable('gapi-parser', 'gapi-parser.cs',
install_dir : gapi_installdir,
install: true)
install: install)
gapi_parser_data = configuration_data()
gapi_parser_data.set('prefix', prefix)
gapi_parser_data.set('RUNTIME', runtime)
configure_file(input: 'gapi3-parser.in',
output: 'gapi3-parser',
configuration : gapi_parser_data,
install_dir: get_option('bindir'),
install: true)
pkg_gapi_parser_data = configuration_data()
pkg_gapi_parser_data .set('VERSION', meson.project_version())
configure_file(input: 'gapi-3.0.pc.in',
output: 'gapi-3.0.pc',
configuration : pkg_gapi_parser_data,
install_dir: pkg_install_dir,
install: true)
install_data('gapi_pp.pl', 'gapi2xml.pl', install_dir: gapi_installdir)
if install
configure_file(input: 'gapi3-parser.in',
output: 'gapi3-parser',
configuration : gapi_parser_data,
install_dir: get_option('bindir'))
configure_file(input: 'gapi-3.0.pc.in',
output: 'gapi-3.0.pc',
configuration : pkg_gapi_parser_data,
install_dir: pkg_install_dir)
install_data('gapi_pp.pl', 'gapi2xml.pl', install_dir: gapi_installdir)
else
configure_file(input: 'gapi3-parser.in',
output: 'gapi3-parser',
configuration : gapi_parser_data)
configure_file(input: 'gapi-3.0.pc.in',
output: 'gapi-3.0.pc',
configuration : pkg_gapi_parser_data)
endif