2019-04-13 23:13:51 -04:00
|
|
|
libev = dependency('libev', required: false)
|
|
|
|
if not libev.found()
|
|
|
|
libev = cc.find_library('ev')
|
|
|
|
endif
|
2018-10-03 17:46:18 -04:00
|
|
|
base_deps = [
|
2018-11-03 18:15:38 -04:00
|
|
|
cc.find_library('m'),
|
2019-10-11 13:11:45 -04:00
|
|
|
libev
|
2018-11-03 18:15:38 -04:00
|
|
|
]
|
2018-10-14 19:38:21 -04:00
|
|
|
|
2019-10-23 14:27:30 -04:00
|
|
|
srcs = [ files('picom.c', 'win.c', 'c2.c', 'x.c', 'config.c', 'vsync.c', 'utils.c',
|
2018-12-20 16:57:32 -05:00
|
|
|
'diagnostic.c', 'string_utils.c', 'render.c', 'kernel.c', 'log.c',
|
2019-11-10 13:58:01 -05:00
|
|
|
'options.c', 'event.c', 'cache.c', 'atom.c', 'file_watch.c') ]
|
2019-10-23 14:27:30 -04:00
|
|
|
picom_inc = include_directories('.')
|
2018-10-14 19:38:21 -04:00
|
|
|
|
2018-11-08 09:53:13 -05:00
|
|
|
cflags = []
|
|
|
|
|
2019-10-11 13:11:45 -04:00
|
|
|
required_xcb_packages = [
|
|
|
|
'xcb-render', 'xcb-damage', 'xcb-randr', 'xcb-sync', 'xcb-composite',
|
2020-03-31 00:59:44 -04:00
|
|
|
'xcb-shape', 'xcb-xinerama', 'xcb-xfixes', 'xcb-present', 'xcb-glx', 'xcb'
|
2019-10-11 13:11:45 -04:00
|
|
|
]
|
2018-10-03 17:46:18 -04:00
|
|
|
|
2019-10-11 13:11:45 -04:00
|
|
|
required_packages = [
|
|
|
|
'x11', 'x11-xcb', 'xcb-renderutil', 'xcb-image', 'xext', 'pixman-1'
|
2018-11-03 18:15:38 -04:00
|
|
|
]
|
2018-10-14 19:38:21 -04:00
|
|
|
|
2019-10-11 13:11:45 -04:00
|
|
|
foreach i : required_packages
|
2018-10-03 17:46:18 -04:00
|
|
|
base_deps += [dependency(i, required: true)]
|
2018-10-14 19:38:21 -04:00
|
|
|
endforeach
|
|
|
|
|
2019-10-11 13:11:45 -04:00
|
|
|
foreach i : required_xcb_packages
|
|
|
|
base_deps += [dependency(i, version: '>=1.12.0', required: true)]
|
|
|
|
endforeach
|
|
|
|
|
2019-04-03 03:36:02 -04:00
|
|
|
if not cc.has_header('uthash.h')
|
|
|
|
error('Dependency uthash not found')
|
|
|
|
endif
|
|
|
|
|
2018-10-03 17:46:18 -04:00
|
|
|
deps = []
|
|
|
|
|
2018-10-14 19:38:21 -04:00
|
|
|
if get_option('config_file')
|
2020-02-25 06:38:28 -05:00
|
|
|
deps += [dependency('libconfig', version: '>=1.4', required: true)]
|
|
|
|
|
2018-10-14 19:38:21 -04:00
|
|
|
cflags += ['-DCONFIG_LIBCONFIG']
|
|
|
|
srcs += [ 'config_libconfig.c' ]
|
|
|
|
endif
|
|
|
|
if get_option('regex')
|
|
|
|
pcre = dependency('libpcre', required: true)
|
|
|
|
cflags += ['-DCONFIG_REGEX_PCRE']
|
|
|
|
if pcre.version().version_compare('>=8.20')
|
|
|
|
cflags += ['-DCONFIG_REGEX_PCRE_JIT']
|
|
|
|
endif
|
|
|
|
deps += [pcre]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('vsync_drm')
|
|
|
|
cflags += ['-DCONFIG_VSYNC_DRM']
|
|
|
|
deps += [dependency('libdrm', required: true)]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('opengl')
|
2018-10-03 17:46:18 -04:00
|
|
|
cflags += ['-DCONFIG_OPENGL', '-DGL_GLEXT_PROTOTYPES']
|
2018-10-14 19:38:21 -04:00
|
|
|
deps += [dependency('gl', required: true)]
|
|
|
|
srcs += [ 'opengl.c' ]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('dbus')
|
|
|
|
cflags += ['-DCONFIG_DBUS']
|
|
|
|
deps += [dependency('dbus-1', required: true)]
|
|
|
|
srcs += [ 'dbus.c' ]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('xrescheck')
|
|
|
|
cflags += ['-DDEBUG_XRC']
|
|
|
|
srcs += [ 'xrescheck.c' ]
|
|
|
|
endif
|
|
|
|
|
2019-03-18 18:34:59 -04:00
|
|
|
if get_option('unittest')
|
|
|
|
cflags += ['-DUNIT_TEST']
|
|
|
|
endif
|
|
|
|
|
2019-11-11 15:46:06 -05:00
|
|
|
host_system = host_machine.system()
|
|
|
|
if host_system == 'linux'
|
|
|
|
cflags += ['-DHAS_INOTIFY']
|
2020-05-28 06:05:35 -04:00
|
|
|
elif (host_system == 'freebsd' or host_system == 'netbsd' or
|
|
|
|
host_system == 'dragonfly' or host_system == 'openbsd')
|
2019-11-11 15:46:06 -05:00
|
|
|
cflags += ['-DHAS_KQUEUE']
|
|
|
|
endif
|
|
|
|
|
2018-10-03 17:46:18 -04:00
|
|
|
subdir('backend')
|
|
|
|
|
2019-10-23 14:27:30 -04:00
|
|
|
picom = executable('picom', srcs, c_args: cflags,
|
2019-03-18 18:34:59 -04:00
|
|
|
dependencies: [ base_deps, deps, test_h_dep ],
|
2019-10-23 14:27:30 -04:00
|
|
|
install: true, include_directories: picom_inc)
|
2019-03-18 18:34:59 -04:00
|
|
|
|
|
|
|
if get_option('unittest')
|
2019-10-23 14:27:30 -04:00
|
|
|
test('picom unittest', picom, args: [ '--unittest' ])
|
2019-03-18 18:34:59 -04:00
|
|
|
endif
|