Skip to content

Commit

Permalink
build: make libconfig mandatory
Browse files Browse the repository at this point in the history
Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Apr 20, 2024
1 parent 709a253 commit cf08a3b
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
executor: e
steps:
- build:
build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false
build-config: -Dopengl=false -Ddbus=false -Dregex=false
release:
executor: e
steps:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
steps:
- build:
cc: clang
build-config: -Dopengl=false -Ddbus=false -Dregex=false -Dconfig_file=false
build-config: -Dopengl=false -Ddbus=false -Dregex=false
clang_nogl:
executor: e
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

* picom now uses some OpenGL 4.3 features.
* picom now optionally depends on `rtkit` at runtime to give itself realtime scheduling priority.
* `libconfig` is now a mandatory dependency.

# v11.2 (2024-Feb-13)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Assuming you already have all the usual building tools installed (e.g. gcc, pyth
* xcb-present
* xcb-glx
* pixman
* libconfig
* libdbus (optional, disable with the `-Ddbus=false` meson configure flag)
* libconfig (optional, disable with the `-Dconfig_file=false` meson configure flag)
* libGL, libEGL, libepoxy (optional, disable with the `-Dopengl=false` meson configure flag)
* libpcre2 (optional, disable with the `-Dregex=false` meson configure flag)
* libev
Expand Down
1 change: 0 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
option('sanitize', type: 'boolean', value: false, description: 'Build with sanitizers enabled (deprecated)')
option('config_file', type: 'boolean', value: true, description: 'Enable config file support')
option('regex', type: 'boolean', value: true, description: 'Enable regex support in window conditions')

option('vsync_drm', type: 'boolean', value: false, description: 'Enable support for using drm for vsync')
Expand Down
8 changes: 0 additions & 8 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,15 +887,7 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
// clang-format on

char *ret = NULL;
#ifdef CONFIG_LIBCONFIG
ret = parse_config_libconfig(opt, config_file, shadow_enable, fading_enable,
hasneg, winopt_mask);
#else
(void)config_file;
(void)shadow_enable;
(void)fading_enable;
(void)hasneg;
(void)winopt_mask;
#endif
return ret;
}
4 changes: 0 additions & 4 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

#include "uthash_extra.h"

#ifdef CONFIG_LIBCONFIG
#include <libconfig.h>
#endif

#include "compiler.h"
#include "kernel.h"
Expand Down Expand Up @@ -311,7 +309,6 @@ void parse_debug_options(struct debug_options *);
*/
bool condlst_add(c2_lptr_t **, const char *);

#ifdef CONFIG_LIBCONFIG
const char *xdg_config_home(void);
char **xdg_config_dirs(void);

Expand All @@ -326,7 +323,6 @@ char **xdg_config_dirs(void);
char *
parse_config_libconfig(options_t *, const char *config_file, bool *shadow_enable,
bool *fading_enable, bool *hasneg, win_option_mask_t *winopt_mask);
#endif

void set_default_winopts(options_t *, win_option_mask_t *, bool shadow_enable,
bool fading_enable, bool blur_enable);
Expand Down
8 changes: 0 additions & 8 deletions src/inspect.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,5 @@

#pragma once
#include <xcb/xcb.h>
#include "compiler.h"

#ifdef CONFIG_LIBCONFIG
int inspect_main(int argc, char **argv, const char *config_file);
#else
static inline int inspect_main(int argc attr_unused, char **argv attr_unused,
const char *config_file attr_unused) {
return 0;
}
#endif
13 changes: 3 additions & 10 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ srcs = [ files('picom.c', 'win.c', 'c2.c', 'x.c', 'config.c', 'vsync.c', 'utils.
'diagnostic.c', 'string_utils.c', 'render.c', 'kernel.c', 'log.c',
'options.c', 'event.c', 'cache.c', 'atom.c', 'file_watch.c', 'statistics.c',
'vblank.c', 'transition.c', 'wm.c', 'renderer/layout.c', 'renderer/command_builder.c',
'renderer/renderer.c', 'renderer/damage.c') ]
'renderer/renderer.c', 'renderer/damage.c', 'config_libconfig.c', 'inspect.c') ]
picom_inc = include_directories('.')

cflags = []
Expand All @@ -34,19 +34,14 @@ endforeach
foreach i : required_xcb_packages
base_deps += [dependency(i, version: '>=1.12.0', required: true)]
endforeach
base_deps += [dependency('libconfig', version: '>=1.4', required: true)]

if not cc.has_header('uthash.h')
error('Dependency uthash not found')
endif

deps = []

if get_option('config_file')
deps += [dependency('libconfig', version: '>=1.4', required: true)]

cflags += ['-DCONFIG_LIBCONFIG']
srcs += [ 'config_libconfig.c', 'inspect.c' ]
endif
if get_option('regex')
pcre = dependency('libpcre2-8', required: true)
cflags += ['-DCONFIG_REGEX_PCRE']
Expand Down Expand Up @@ -97,9 +92,7 @@ if get_option('unittest')
test('picom unittest', picom, args: [ '--unittest' ])
endif

if get_option('config_file')
install_symlink('picom-inspect', install_dir: 'bin', pointing_to: 'picom')
endif
install_symlink('picom-inspect', install_dir: 'bin', pointing_to: 'picom')

if cc.has_argument('-fsanitize=fuzzer')
c2_fuzz = executable('c2_fuzz', srcs + ['fuzzer/c2.c'],
Expand Down
2 changes: 0 additions & 2 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ struct picom_option {
// clang-format off
static const struct option *longopts = NULL;
static const struct picom_option picom_options[] = {
#ifdef CONFIG_LIBCONFIG
{"config" , required_argument, 256, NULL , "Path to the configuration file."},
#endif
{"help" , no_argument , 'h', NULL , "Print this help message and exit."},
{"shadow-radius" , required_argument, 'r', NULL , "The blur radius for shadows. (default 12)"},
{"shadow-opacity" , required_argument, 'o', NULL , "The translucency for shadows. (default .75)"},
Expand Down

0 comments on commit cf08a3b

Please sign in to comment.