From 65ade59835848720ec6f26daa5af32a5f780d4be Mon Sep 17 00:00:00 2001 From: Moses Miller Date: Fri, 28 Apr 2023 14:54:35 -0700 Subject: FindX11: Remove HAS_X11_xcb check from xcb tests --- Tests/FindX11/Test/CMakeLists.txt | 10 +- Tests/FindX11/Test/main.c | 226 ++++++++++++++++++++++---------------- 2 files changed, 131 insertions(+), 105 deletions(-) diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt index afc10c9..3312f6f 100644 --- a/Tests/FindX11/Test/CMakeLists.txt +++ b/Tests/FindX11/Test/CMakeLists.txt @@ -11,14 +11,8 @@ function (test_x11_component have_var component) endif () add_executable(test_tgt_${component} main.c) - - if (component MATCHES xcb) - target_link_libraries(test_tgt_${component} PRIVATE X11::${component} X11::xcb) - target_compile_definitions(test_tgt_${component} PRIVATE HAVE_X11_${component} HAVE_X11_xcb) - else() - target_link_libraries(test_tgt_${component} PRIVATE X11::${component}) - target_compile_definitions(test_tgt_${component} PRIVATE HAVE_X11_${component}) - endif() + target_link_libraries(test_tgt_${component} PRIVATE X11::${component}) + target_compile_definitions(test_tgt_${component} PRIVATE HAVE_X11_${component}) add_test(NAME test_tgt_${component} COMMAND test_tgt_${component}) # Add to the list of components to test for the parent. diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c index d227348..2542145 100644 --- a/Tests/FindX11/Test/main.c +++ b/Tests/FindX11/Test/main.c @@ -336,8 +336,11 @@ static void test_xcb(void) xcb_disconnect(connection); } -# ifdef HAVE_X11_xcb_composite -# include +#endif + +#ifdef HAVE_X11_xcb_composite +# include +# include static void test_xcb_composite(void) { @@ -346,10 +349,11 @@ static void test_xcb_composite(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_cursor -# include +#ifdef HAVE_X11_xcb_cursor +# include +# include static void test_xcb_cursor(void) { @@ -363,10 +367,11 @@ static void test_xcb_cursor(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_damage -# include +#ifdef HAVE_X11_xcb_damage +# include +# include static void test_xcb_damage(void) { @@ -377,10 +382,11 @@ static void test_xcb_damage(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_dpms -# include +#ifdef HAVE_X11_xcb_dpms +# include +# include static void test_xcb_dpms(void) { @@ -391,10 +397,11 @@ static void test_xcb_dpms(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_dri2 -# include +#ifdef HAVE_X11_xcb_dri2 +# include +# include static void test_xcb_dri2(void) { @@ -405,10 +412,11 @@ static void test_xcb_dri2(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_dri3 -# include +#ifdef HAVE_X11_xcb_dri3 +# include +# include static void test_xcb_dri3(void) { @@ -419,10 +427,11 @@ static void test_xcb_dri3(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_errors -# include +#ifdef HAVE_X11_xcb_errors +# include +# include static void test_xcb_errors(void) { @@ -434,10 +443,11 @@ static void test_xcb_errors(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_ewmh -# include +#ifdef HAVE_X11_xcb_ewmh +# include +# include static void test_xcb_ewmh(void) { @@ -451,10 +461,11 @@ static void test_xcb_ewmh(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_glx -# include +#ifdef HAVE_X11_xcb_glx +# include +# include static void test_xcb_glx(void) { @@ -465,10 +476,11 @@ static void test_xcb_glx(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_icccm -# include +#ifdef HAVE_X11_xcb_icccm +# include +# include static void test_xcb_icccm(void) { @@ -482,10 +494,11 @@ static void test_xcb_icccm(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_image -# include +#ifdef HAVE_X11_xcb_image +# include +# include static void test_xcb_image(void) { @@ -497,10 +510,11 @@ static void test_xcb_image(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_keysyms -# include +#ifdef HAVE_X11_xcb_keysyms +# include +# include static void test_xcb_keysyms(void) { @@ -512,10 +526,11 @@ static void test_xcb_keysyms(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_present -# include +#ifdef HAVE_X11_xcb_present +# include +# include static void test_xcb_present(void) { @@ -526,10 +541,11 @@ static void test_xcb_present(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_randr -# include +#ifdef HAVE_X11_xcb_randr +# include +# include static void test_xcb_randr(void) { @@ -540,10 +556,11 @@ static void test_xcb_randr(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_record -# include +#ifdef HAVE_X11_xcb_record +# include +# include static void test_xcb_record(void) { @@ -554,10 +571,11 @@ static void test_xcb_record(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_render -# include +#ifdef HAVE_X11_xcb_render +# include +# include static void test_xcb_render(void) { @@ -568,10 +586,11 @@ static void test_xcb_render(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_render_util -# include +#ifdef HAVE_X11_xcb_render_util +# include +# include static void test_xcb_render_util(void) { @@ -582,10 +601,11 @@ static void test_xcb_render_util(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_res -# include +#ifdef HAVE_X11_xcb_res +# include +# include static void test_xcb_res(void) { @@ -596,10 +616,11 @@ static void test_xcb_res(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_screensaver -# include +#ifdef HAVE_X11_xcb_screensaver +# include +# include static void test_xcb_screensaver(void) { @@ -610,10 +631,11 @@ static void test_xcb_screensaver(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_shape -# include +#ifdef HAVE_X11_xcb_shape +# include +# include static void test_xcb_shape(void) { @@ -624,10 +646,11 @@ static void test_xcb_shape(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_shm -# include +#ifdef HAVE_X11_xcb_shm +# include +# include static void test_xcb_shm(void) { @@ -637,10 +660,11 @@ static void test_xcb_shm(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_sync -# include +#ifdef HAVE_X11_xcb_sync +# include +# include static void test_xcb_sync(void) { @@ -650,10 +674,11 @@ static void test_xcb_sync(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_util -# include +#ifdef HAVE_X11_xcb_util +# include +# include static void test_xcb_util(void) { @@ -663,10 +688,11 @@ static void test_xcb_util(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xf86dri -# include +#ifdef HAVE_X11_xcb_xf86dri +# include +# include static void test_xcb_xf86dri(void) { @@ -677,10 +703,11 @@ static void test_xcb_xf86dri(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xfixes -# include +#ifdef HAVE_X11_xcb_xfixes +# include +# include static void test_xcb_xfixes(void) { @@ -690,10 +717,11 @@ static void test_xcb_xfixes(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xinerama -# include +#ifdef HAVE_X11_xcb_xinerama +# include +# include static void test_xcb_xinerama(void) { @@ -704,10 +732,11 @@ static void test_xcb_xinerama(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xinput -# include +#ifdef HAVE_X11_xcb_xinput +# include +# include static void test_xcb_xinput(void) { @@ -718,10 +747,11 @@ static void test_xcb_xinput(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xkb -# include +#ifdef HAVE_X11_xcb_xkb +# include +# include static void test_xcb_xkb(void) { @@ -732,10 +762,11 @@ static void test_xcb_xkb(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xrm -# include +#ifdef HAVE_X11_xcb_xrm +# include +# include static void test_xcb_xrm(void) { @@ -746,10 +777,11 @@ static void test_xcb_xrm(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xtest -# include +#ifdef HAVE_X11_xcb_xtest +# include +# include static void test_xcb_xtest(void) { @@ -759,10 +791,11 @@ static void test_xcb_xtest(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xvmc -# include +#ifdef HAVE_X11_xcb_xvmc +# include +# include static void test_xcb_xvmc(void) { @@ -772,10 +805,11 @@ static void test_xcb_xvmc(void) xcb_disconnect(connection); } -# endif +#endif -# ifdef HAVE_X11_xcb_xv -# include +#ifdef HAVE_X11_xcb_xv +# include +# include static void test_xcb_xv(void) { @@ -785,8 +819,6 @@ static void test_xcb_xv(void) xcb_disconnect(connection); } -# endif - #endif #include -- cgit v0.12