meson: move HTTP doc url generation to here
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 17 Oct 2019 03:39:23 +0000 (13:39 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 17 Oct 2019 08:31:28 +0000 (08:31 +0000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
meson.build
src/libinput-private.h

index 38ac838..3d2e891 100644 (file)
@@ -50,6 +50,15 @@ add_project_arguments(cppflags, language : 'cpp')
 
 # config.h
 config_h = configuration_data()
+
+doc_url_base = 'https://wayland.freedesktop.org/libinput/doc'
+if libinput_version[2].to_int() >= 90
+       doc_url = '@0@/latest'.format(doc_url_base)
+else
+       doc_url = '@0@/@1@'.format(doc_url_base, meson.project_version())
+endif
+config_h.set_quoted('HTTP_DOC_LINK', doc_url)
+
 config_h.set('_GNU_SOURCE', '1')
 if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimized'
        config_h.set_quoted('MESON_BUILD_ROOT', meson.current_build_dir())
index abb4789..1a7900f 100644 (file)
 #include "libinput-util.h"
 #include "libinput-version.h"
 
-#if LIBINPUT_VERSION_MICRO >= 90
-#define HTTP_DOC_LINK "https://wayland.freedesktop.org/libinput/doc/latest/"
-#else
-#define HTTP_DOC_LINK "https://wayland.freedesktop.org/libinput/doc/" LIBINPUT_VERSION "/"
-#endif
-
 struct libinput_source;
 
 /* A coordinate pair in device coordinates */