Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation times improvement #2455

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@

build/**

# End of https://www.toptal.com/developers/gitignore/api/c++,meson,ninja,linux
.cache/**

# End of https://www.toptal.com/developers/gitignore/api/c++,meson,ninja,linux
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ libinput = dependency('libinput', version: '>=1.7.0')
pixman = dependency('pixman-1')
xkbcommon = dependency('xkbcommon')
libdl = meson.get_compiler('cpp').find_library('dl')
json = dependency('nlohmann_json', version: '>= 3.11.2')
json = dependency('jsoncpp')

# We're not to use system wlroots: So we'll use the subproject
if get_option('use_system_wlroots').disabled()
Expand Down Expand Up @@ -145,7 +145,7 @@ cpp = meson.get_compiler('cpp')
# -E is for RTTI/dynamic_cast across plugins
add_project_link_arguments(['-rdynamic', '-Wl,-E'], language: 'cpp')

project_args = ['-DWLR_USE_UNSTABLE']
project_args = ['-DWLR_USE_UNSTABLE', '-ftime-trace']
# Needed for dlclose to actually free plugin memory on gcc+glibc
if cpp.has_argument('-fno-gnu-unique')
project_args += '-fno-gnu-unique'
Expand Down Expand Up @@ -196,7 +196,7 @@ else
print_trace = false
endif

add_project_arguments(['-DWF_USE_CONFIG_H'], language: ['cpp', 'c'])
add_project_arguments(['-DWF_USE_CONFIG_H', '-ftime-trace'], language: ['cpp', 'c'])
configure_file(input: 'config.h.in',
output: 'config.h',
install: true,
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ option('xwayland', type: 'feature', value: 'auto', description: 'Build with xway
option('default_config_backend', type: 'string', value: 'default', description: 'Default configuration backend to use')
option('print_trace', type: 'boolean', value: true, description: 'Print stack trace in debug logs (disables coredump)')
option('tests', type: 'feature', value: 'auto', description: 'Enable unit tests')
option('custom_pch', type: 'boolean', value: false, description: 'Use custom PCH for plugins. May not work with all compilers and setups.')
8 changes: 7 additions & 1 deletion plugins/animate/meson.build
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
dependencies = [wlroots, pixman, wfconfig]
animate_pch_deps = [plugin_pch_dep]
animate_pch_flags = plugin_pch_args

if get_option('enable_openmp')
dependencies += [dependency('openmp')]
# PCH does not have openmp enabled
animate_pch_deps = []
animate_pch_args = []
endif

animiate = shared_module('animate',
['animate.cpp',
'fire/particle.cpp',
'fire/fire.cpp'],
include_directories: [wayfire_api_inc, wayfire_conf_inc],
dependencies: dependencies,
dependencies: dependencies + animate_pch_deps,
cpp_args: animate_pch_args,
install: true,
install_dir: join_paths(get_option('libdir'), 'wayfire'))
1 change: 1 addition & 0 deletions plugins/blur/blur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "wayfire/scene-render.hpp"
#include "wayfire/scene.hpp"
#include "wayfire/signal-provider.hpp"
#include <list>

using blur_algorithm_provider =
std::function<nonstd::observer_ptr<wf_blur_base>()>;
Expand Down
6 changes: 4 additions & 2 deletions plugins/blur/meson.build
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
blur_base = shared_library('wayfire-blur-base',
['blur-base.cpp', 'box.cpp', 'gaussian.cpp', 'kawase.cpp', 'bokeh.cpp'],
include_directories: [wayfire_api_inc, wayfire_conf_inc],
dependencies: [wlroots, pixman, wfconfig],
dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
cpp_args: plugin_pch_args,
override_options: ['b_lundef=false'],
install: true)
install_headers(['blur.hpp'], subdir: 'wayfire/plugins/blur')

blur = shared_module('blur', ['blur.cpp'],
link_with: blur_base,
include_directories: [wayfire_api_inc, wayfire_conf_inc],
dependencies: [wlroots, pixman, wfconfig],
dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
cpp_args: plugin_pch_args,
install: true, install_dir: join_paths(get_option('libdir'), 'wayfire'))
16 changes: 16 additions & 0 deletions plugins/common/meson.build
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
plugins_common_inc = include_directories('.')
install_subdir('wayfire', install_dir: get_option('includedir'))

workspace_wall = static_library('wayfire-workspace-wall',
['workspace-wall.cpp'],
include_directories: [wayfire_api_inc, wayfire_conf_inc],
dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
cpp_args: plugin_pch_args,
override_options: ['b_lundef=false'],
install: true)

move_drag_interface = static_library('wayfire-move-drag-interface',
['move-drag-interface.cpp'],
include_directories: [wayfire_api_inc, wayfire_conf_inc],
dependencies: [wlroots, pixman, wfconfig, plugin_pch_dep],
cpp_args: plugin_pch_args,
override_options: ['b_lundef=false'],
install: true)
Loading
Loading