diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..f80b8690 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/subprojects/packagecache/ +/subprojects/xcb-util-keysyms-0.4.1/ diff --git a/meson.build b/meson.build index d89346fe..5097173e 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cog', 'c', - meson_version: '>=0.53.2', + meson_version: '>=0.55', default_options: [ 'buildtype=debugoptimized', 'b_ndebug=if-release', diff --git a/platform/x11/cog-platform-x11.c b/platform/x11/cog-platform-x11.c index ac42b6ae..9db380db 100644 --- a/platform/x11/cog-platform-x11.c +++ b/platform/x11/cog-platform-x11.c @@ -20,7 +20,11 @@ #include #ifdef COG_X11_USE_XCB_KEYSYMS -# include +# if __has_include() +# include +# else +# include +# endif #endif /* COG_X11_USE_XCB_KEYSYMS */ #ifdef COG_X11_USE_XKB diff --git a/subprojects/packagefiles/xcb-util-keysyms-0.4.1/meson.build b/subprojects/packagefiles/xcb-util-keysyms-0.4.1/meson.build new file mode 100644 index 00000000..60469c36 --- /dev/null +++ b/subprojects/packagefiles/xcb-util-keysyms-0.4.1/meson.build @@ -0,0 +1,24 @@ +project('xcb-util-keysyms', 'c', + version: '0.4.1', + default_options: [ + ], +) + +xcb_dep = dependency('xcb', version: '>=1.4') +xcb_util_keysyms_dependencies = [xcb_dep, dependency('xproto', version: '>=7.0.8')] + +xcb_proto_version = xcb_dep.get_variable('xcbproto_version') +assert(xcb_proto_version.version_compare('>=1.6'), + 'libxcb was compiled against xcb-proto @0@, it needs to be compiled against 1.6 or newer'.format(xcb_proto_version)) + +xcb_util_keysyms_lib = static_library('xcb-util-keysyms', + 'keysyms/keysyms.c', + dependencies: xcb_util_keysyms_dependencies, + pic: true, +) + +xcb_util_keysyms_dep = declare_dependency( + link_with: xcb_util_keysyms_lib, + dependencies: xcb_util_keysyms_dependencies, + include_directories: include_directories('keysyms'), +) diff --git a/subprojects/xcb-keysyms.wrap b/subprojects/xcb-keysyms.wrap new file mode 100644 index 00000000..8b78d33f --- /dev/null +++ b/subprojects/xcb-keysyms.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = xcb-util-keysyms-0.4.1 +source_url = https://xcb.freedesktop.org/dist/xcb-util-keysyms-0.4.1.tar.xz +source_filename = xcb-util-keysyms-0.4.1.tar.xz +source_hash = 7c260a5294412aed429df1da2f8afd3bd07b7cba3fec772fba15a613a6d5c638 +patch_directory = xcb-util-keysyms-0.4.1 + +[provide] +xcb-keysyms = xcb_util_keysyms_dep