From 06cd74a237cec28049599387e5c525973c611444 Mon Sep 17 00:00:00 2001 From: Mario Daniel Ruiz Saavedra Date: Mon, 19 Dec 2022 18:04:09 -0500 Subject: [PATCH 1/4] Add Meson support Initial impl. Ignored docs for now --- meson.build | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..ca53608 --- /dev/null +++ b/meson.build @@ -0,0 +1,136 @@ +project('mouse_m908', ['cpp', 'c'], + version: '3.3', + meson_version: '>= 0.59.0', + default_options: [ 'warning_level=2', + 'cpp_std=gnu++2a', + ], +) + +libusb_dep = dependency('libusb-1.0') + +sources = files( + 'mouse_m908.cpp', + 'include/data.cpp', + 'include/help.h', + 'include/load_config.cpp', + 'include/load_config.h', + 'include/rd_mouse.cpp', + 'include/rd_mouse.h', + 'include/rd_mouse_wireless.cpp', + 'include/rd_mouse_wireless.h', + 'include/generic/constructor.cpp', + 'include/generic/data.cpp', + 'include/generic/getters.cpp', + 'include/generic/helpers.cpp', + 'include/generic/mouse_generic.h', + 'include/generic/readers.cpp', + 'include/generic/setters.cpp', + 'include/generic/writers.cpp', + 'include/m607/constructor.cpp', + 'include/m607/data.cpp', + 'include/m607/getters.cpp', + 'include/m607/helpers.cpp', + 'include/m607/mouse_m607.h', + 'include/m607/readers.cpp', + 'include/m607/setters.cpp', + 'include/m607/writers.cpp', + 'include/m686/constructor.cpp', + 'include/m686/data.cpp', + 'include/m686/getters.cpp', + 'include/m686/helpers.cpp', + 'include/m686/mouse_m686.h', + 'include/m686/readers.cpp', + 'include/m686/setters.cpp', + 'include/m686/writers.cpp', + 'include/m709/constructor.cpp', + 'include/m709/data.cpp', + 'include/m709/getters.cpp', + 'include/m709/helpers.cpp', + 'include/m709/mouse_m709.h', + 'include/m709/readers.cpp', + 'include/m709/setters.cpp', + 'include/m709/writers.cpp', + 'include/m711/constructor.cpp', + 'include/m711/data.cpp', + 'include/m711/getters.cpp', + 'include/m711/helpers.cpp', + 'include/m711/mouse_m711.h', + 'include/m711/readers.cpp', + 'include/m711/setters.cpp', + 'include/m711/writers.cpp', + 'include/m715/constructor.cpp', + 'include/m715/data.cpp', + 'include/m715/getters.cpp', + 'include/m715/helpers.cpp', + 'include/m715/mouse_m715.h', + 'include/m715/readers.cpp', + 'include/m715/setters.cpp', + 'include/m715/writers.cpp', + 'include/m719/constructor.cpp', + 'include/m719/data.cpp', + 'include/m719/getters.cpp', + 'include/m719/helpers.cpp', + 'include/m719/mouse_m719.h', + 'include/m719/readers.cpp', + 'include/m719/setters.cpp', + 'include/m719/writers.cpp', + 'include/m721/constructor.cpp', + 'include/m721/data.cpp', + 'include/m721/getters.cpp', + 'include/m721/helpers.cpp', + 'include/m721/mouse_m721.h', + 'include/m721/readers.cpp', + 'include/m721/setters.cpp', + 'include/m721/writers.cpp', + 'include/m908/constructor.cpp', + 'include/m908/data.cpp', + 'include/m908/getters.cpp', + 'include/m908/helpers.cpp', + 'include/m908/mouse_m908.h', + 'include/m908/readers.cpp', + 'include/m908/setters.cpp', + 'include/m908/writers.cpp', + 'include/m913/constructor.cpp', + 'include/m913/data.cpp', + 'include/m913/getters.cpp', + 'include/m913/helpers.cpp', + 'include/m913/mouse_m913.h', + 'include/m913/readers.cpp', + 'include/m913/setters.cpp', + 'include/m913/writers.cpp', + 'include/m990/constructor.cpp', + 'include/m990/data.cpp', + 'include/m990/getters.cpp', + 'include/m990/helpers.cpp', + 'include/m990/mouse_m990.h', + 'include/m990/readers.cpp', + 'include/m990/setters.cpp', + 'include/m990/writers.cpp', + 'include/m990chroma/constructor.cpp', + 'include/m990chroma/data.cpp', + 'include/m990chroma/getters.cpp', + 'include/m990chroma/helpers.cpp', + 'include/m990chroma/mouse_m990chroma.h', + 'include/m990chroma/readers.cpp', + 'include/m990chroma/setters.cpp', + 'include/m990chroma/writers.cpp' + +) + +udev_dep = dependency('udev') +udev_rules_dir = udev_dep.get_variable(pkgconfig:'udevdir') + + +executable('mouse_m908', sources, + dependencies: [libusb_dep], + install: true, +) +if host_machine.system() == 'linux' + install_data('mouse_m908.rules', + install_dir: join_paths(udev_rules_dir, 'rules.d') + ) +endif +install_data('mouse_m908.1', + install_dir: get_option('mandir') +) + From d790f7cfe1f25c2124b7a0a0b0144b52b9fecdba Mon Sep 17 00:00:00 2001 From: Mario Daniel Ruiz Saavedra Date: Mon, 14 Aug 2023 16:29:04 -0500 Subject: [PATCH 2/4] Simplify meson sources --- meson.build | 114 ++++++++-------------------------------------------- 1 file changed, 16 insertions(+), 98 deletions(-) diff --git a/meson.build b/meson.build index ca53608..2449851 100644 --- a/meson.build +++ b/meson.build @@ -17,106 +17,24 @@ sources = files( 'include/rd_mouse.cpp', 'include/rd_mouse.h', 'include/rd_mouse_wireless.cpp', - 'include/rd_mouse_wireless.h', - 'include/generic/constructor.cpp', - 'include/generic/data.cpp', - 'include/generic/getters.cpp', - 'include/generic/helpers.cpp', - 'include/generic/mouse_generic.h', - 'include/generic/readers.cpp', - 'include/generic/setters.cpp', - 'include/generic/writers.cpp', - 'include/m607/constructor.cpp', - 'include/m607/data.cpp', - 'include/m607/getters.cpp', - 'include/m607/helpers.cpp', - 'include/m607/mouse_m607.h', - 'include/m607/readers.cpp', - 'include/m607/setters.cpp', - 'include/m607/writers.cpp', - 'include/m686/constructor.cpp', - 'include/m686/data.cpp', - 'include/m686/getters.cpp', - 'include/m686/helpers.cpp', - 'include/m686/mouse_m686.h', - 'include/m686/readers.cpp', - 'include/m686/setters.cpp', - 'include/m686/writers.cpp', - 'include/m709/constructor.cpp', - 'include/m709/data.cpp', - 'include/m709/getters.cpp', - 'include/m709/helpers.cpp', - 'include/m709/mouse_m709.h', - 'include/m709/readers.cpp', - 'include/m709/setters.cpp', - 'include/m709/writers.cpp', - 'include/m711/constructor.cpp', - 'include/m711/data.cpp', - 'include/m711/getters.cpp', - 'include/m711/helpers.cpp', - 'include/m711/mouse_m711.h', - 'include/m711/readers.cpp', - 'include/m711/setters.cpp', - 'include/m711/writers.cpp', - 'include/m715/constructor.cpp', - 'include/m715/data.cpp', - 'include/m715/getters.cpp', - 'include/m715/helpers.cpp', - 'include/m715/mouse_m715.h', - 'include/m715/readers.cpp', - 'include/m715/setters.cpp', - 'include/m715/writers.cpp', - 'include/m719/constructor.cpp', - 'include/m719/data.cpp', - 'include/m719/getters.cpp', - 'include/m719/helpers.cpp', - 'include/m719/mouse_m719.h', - 'include/m719/readers.cpp', - 'include/m719/setters.cpp', - 'include/m719/writers.cpp', - 'include/m721/constructor.cpp', - 'include/m721/data.cpp', - 'include/m721/getters.cpp', - 'include/m721/helpers.cpp', - 'include/m721/mouse_m721.h', - 'include/m721/readers.cpp', - 'include/m721/setters.cpp', - 'include/m721/writers.cpp', - 'include/m908/constructor.cpp', - 'include/m908/data.cpp', - 'include/m908/getters.cpp', - 'include/m908/helpers.cpp', - 'include/m908/mouse_m908.h', - 'include/m908/readers.cpp', - 'include/m908/setters.cpp', - 'include/m908/writers.cpp', - 'include/m913/constructor.cpp', - 'include/m913/data.cpp', - 'include/m913/getters.cpp', - 'include/m913/helpers.cpp', - 'include/m913/mouse_m913.h', - 'include/m913/readers.cpp', - 'include/m913/setters.cpp', - 'include/m913/writers.cpp', - 'include/m990/constructor.cpp', - 'include/m990/data.cpp', - 'include/m990/getters.cpp', - 'include/m990/helpers.cpp', - 'include/m990/mouse_m990.h', - 'include/m990/readers.cpp', - 'include/m990/setters.cpp', - 'include/m990/writers.cpp', - 'include/m990chroma/constructor.cpp', - 'include/m990chroma/data.cpp', - 'include/m990chroma/getters.cpp', - 'include/m990chroma/helpers.cpp', - 'include/m990chroma/mouse_m990chroma.h', - 'include/m990chroma/readers.cpp', - 'include/m990chroma/setters.cpp', - 'include/m990chroma/writers.cpp' - + 'include/rd_mouse_wireless.h' ) +devices = ['generic', 'm607', 'm686', 'm709', 'm711', 'm715', 'm719', 'm721', 'm908', 'm913', 'm990', 'm990chroma'] + +foreach device : devices + sources += files( + f'include/@device@/constructor.cpp', + f'include/@device@/data.cpp', + f'include/@device@/getters.cpp', + f'include/@device@/helpers.cpp', + f'include/@device@/mouse_@device@.h', + f'include/@device@/readers.cpp', + f'include/@device@/setters.cpp', + f'include/@device@/writers.cpp' + ) +endforeach + udev_dep = dependency('udev') udev_rules_dir = udev_dep.get_variable(pkgconfig:'udevdir') From 283ce0b1ec6e9a1a9dde61998fe14e811df62c8a Mon Sep 17 00:00:00 2001 From: Mario Daniel Ruiz Saavedra Date: Mon, 14 Aug 2023 16:55:41 -0500 Subject: [PATCH 3/4] Only use the udev dep if on linux --- meson.build | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 2449851..93dc29f 100644 --- a/meson.build +++ b/meson.build @@ -35,15 +35,13 @@ foreach device : devices ) endforeach -udev_dep = dependency('udev') -udev_rules_dir = udev_dep.get_variable(pkgconfig:'udevdir') - - executable('mouse_m908', sources, dependencies: [libusb_dep], install: true, ) if host_machine.system() == 'linux' + udev_dep = dependency('udev') + udev_rules_dir = udev_dep.get_variable(pkgconfig:'udevdir') install_data('mouse_m908.rules', install_dir: join_paths(udev_rules_dir, 'rules.d') ) From d105204a3f460548a97c14286352e60b014edff3 Mon Sep 17 00:00:00 2001 From: Mario Daniel Ruiz Saavedra Date: Mon, 14 Aug 2023 17:00:09 -0500 Subject: [PATCH 4/4] Change C++ standard to 17 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 93dc29f..927909a 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project('mouse_m908', ['cpp', 'c'], version: '3.3', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', - 'cpp_std=gnu++2a', + 'cpp_std=c++17', ], )